From 3bf88587277b83c0b6f058fabba7d46a3b5a6a00 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 28 Aug 2008 14:41:54 +0000 Subject: Update svn properties, formatting cleanup. --- OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs | 7 +- .../Region/ClientStack/LindenUDP/LLClientView.cs | 14 +-- .../ClientStack/LindenUDP/LLPacketHandler.cs | 4 +- .../Region/Communications/OGS1/OGS1GridServices.cs | 14 +-- .../Currency/SampleMoney/SampleMoneyModule.cs | 6 +- .../Modules/InterGrid/OpenGridProtocolModule.cs | 138 ++++++++------------- .../Modules/World/Archiver/ArchiveConstants.cs | 2 +- .../Modules/World/Archiver/ArchiveReadRequest.cs | 6 +- .../Environment/Modules/World/NPC/NPCAvatar.cs | 4 +- .../Modules/World/WorldMap/MapImageModule.cs | 2 +- .../World/WorldMap/ShadedMapTileRenderer.cs | 10 +- .../World/WorldMap/TexturedMapTileRenderer.cs | 32 ++--- OpenSim/Region/Environment/Scenes/Scene.cs | 60 +++------ .../Scenes/SceneCommunicationService.cs | 2 +- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 6 +- OpenSim/Region/Physics/Meshing/Mesh.cs | 2 +- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 7 +- OpenSim/Region/Physics/Meshing/PrimMesher.cs | 97 +++++++-------- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 40 +++--- .../Shared/Api/Implementation/LSL_Api.cs | 34 ++--- .../Region/ScriptEngine/XEngine/EventManager.cs | 3 +- 21 files changed, 208 insertions(+), 282 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs b/OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs index 616d8d9..d7d9128 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs @@ -34,7 +34,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { /// /// When packetqueue dequeues this packet in the outgoing stream, it thread aborts - /// Ensures that the thread abort happens from within the client thread + /// Ensures that the thread abort happens from within the client thread /// regardless of where the close method is called /// class KillPacket : Packet @@ -42,20 +42,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP private Header header; public override void FromBytes(Header header, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer) { - } public override void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer) { - } - + public override Header Header { get { return header; } set { header = value; }} public override byte[] ToBytes() { return new byte[0]; } + public KillPacket() { Header = new LowHeader(); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index fc99334..0a067d5 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -373,7 +373,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public bool SendLogoutPacketWhenClosing { set { m_SendLogoutPacketWhenClosing = value; } - } + } /* METHODS */ @@ -459,10 +459,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP { GC.Collect(); - // Sends a KillPacket object, with which, the - // blockingqueue dequeues and sees it's a killpacket + // Sends a KillPacket object, with which, the + // blockingqueue dequeues and sees it's a killpacket // and terminates within the context of the client thread. - // This ensures that it's done from within the context + // This ensures that it's done from within the context // of the client thread regardless of where Close() is called. KillEndDone(); } @@ -2099,8 +2099,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP #endregion // Gesture - - #region Appearance/ Wearables Methods @@ -5964,11 +5962,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (handlerActivateGesture != null) { handlerActivateGesture(this, - activateGesturePacket.Data[0].AssetID, + activateGesturePacket.Data[0].AssetID, activateGesturePacket.Data[0].ItemID); } else m_log.Error("Null pointer for activateGesture"); - + break; case PacketType.DeactivateGestures: diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index e874394..551e7ab 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs @@ -234,7 +234,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // to. Packet drop notifies will not be triggered in this // configuration! // - + if ((m_SynchronizeClient != null) && (!m_Client.IsActive)) { if (m_SynchronizeClient(m_Client.Scene, packet, @@ -749,7 +749,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // If we sent a killpacket if (packet is KillPacket) Thread.CurrentThread.Abort(); - + // Actually make the byte array and send it byte[] sendbuffer = packet.ToBytes(); diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index abaf743..da2e4a2 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -260,9 +260,9 @@ namespace OpenSim.Region.Communications.OGS1 catch (SocketException e) { m_log.WarnFormat( - "[OGS1 GRID SERVICES]: RequestNeighbours(): Lookup of neighbour {0} failed! Not including in neighbours list. {1}", + "[OGS1 GRID SERVICES]: RequestNeighbours(): Lookup of neighbour {0} failed! Not including in neighbours list. {1}", simIp, e); - + continue; } @@ -304,7 +304,7 @@ namespace OpenSim.Region.Communications.OGS1 SendParams.Add(requestData); XmlRpcRequest gridReq = new XmlRpcRequest("simulator_data_request", SendParams); XmlRpcResponse gridResp = null; - + try { gridResp = gridReq.Send(serversInfo.GridURL, 3000); @@ -312,9 +312,9 @@ namespace OpenSim.Region.Communications.OGS1 catch (WebException e) { m_log.ErrorFormat( - "[OGS1 GRID SERVICES]: Communication with the grid server at {0} failed, {1}", + "[OGS1 GRID SERVICES]: Communication with the grid server at {0} failed, {1}", serversInfo.GridURL, e); - + return null; } @@ -1621,14 +1621,14 @@ namespace OpenSim.Region.Communications.OGS1 { m_log.DebugFormat( "[OGS1 GRID SERVICES]: CheckRegion Socket Setup exception: {0}:{1}", e.Message, e.StackTrace); - + return false; } if (timed_out) { m_log.DebugFormat( - "[OGS1 GRID SERVICES]: socket [{0}] timed out ({1}) waiting to obtain a connection.", + "[OGS1 GRID SERVICES]: socket [{0}] timed out ({1}) waiting to obtain a connection.", m_EndPoint, timeOut * 1000); if (retry) diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs index 77dd0f9..9f01ad8 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs @@ -1537,7 +1537,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney { GetClientFunds(client); - lock(m_KnownClientFunds) + lock (m_KnownClientFunds) { if (!m_KnownClientFunds.ContainsKey(client.AgentId)) return 0; @@ -1570,7 +1570,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney int funds = m_KnownClientFunds[remoteClient.AgentId]; - if(salePrice != 0 && funds < salePrice) + if (salePrice != 0 && funds < salePrice) { remoteClient.SendAgentAlertMessage("Unable to buy now. You don't have sufficient funds.", false); return; @@ -1584,7 +1584,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney remoteClient.SendAgentAlertMessage("Unable to buy now. The object was not found.", false); return; } - + doMoneyTransfer(remoteClient.AgentId, part.OwnerID, salePrice, 5000, "Object buy"); s.PerformObjectBuy(remoteClient, categoryID, localID, saleType); diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs index 926e584..0c15637 100644 --- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs @@ -83,16 +83,13 @@ namespace OpenSim.Region.Environment.Modules.InterGrid public bool visible_to_parent; } - public class OpenGridProtocolModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private List m_scene = new List(); - + private Dictionary CapsLoginID = new Dictionary(); private Dictionary m_OGPState = new Dictionary(); - - #region IRegionModule Members @@ -134,7 +131,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid m_log.Error("[OGP]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions."); } } - + } if (!m_scene.Contains(scene)) @@ -217,15 +214,12 @@ namespace OpenSim.Region.Environment.Modules.InterGrid m_log.WarnFormat("[REQUESTREZAVATAR]: {0}", request.ToString()); LLSDMap requestMap = (LLSDMap)request; - + Scene homeScene = GetRootScene(); - - if (homeScene == null) return GenerateNoHandlerMessage(); - RegionInfo reg = homeScene.RegionInfo; ulong regionhandle = GetOSCompatibleRegionHandle(reg); //string RegionURI = reg.ServerURI; @@ -234,14 +228,13 @@ namespace OpenSim.Region.Environment.Modules.InterGrid LLUUID RemoteAgentID = requestMap["agent_id"].AsUUID(); // will be used in the future. The client always connects with the aditi agentid currently - LLUUID LocalAgentID = RemoteAgentID; + LLUUID LocalAgentID = RemoteAgentID; string FirstName = requestMap["first_name"].AsString(); string LastName = requestMap["last_name"].AsString(); - OGPState userState = GetOGPState(LocalAgentID); - + userState.first_name = requestMap["first_name"].AsString(); userState.last_name = requestMap["last_name"].AsString(); userState.age_verified = requestMap["age_verified"].AsBoolean(); @@ -268,7 +261,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid responseMap["region_Y"] = LLSD.FromInteger(reg.RegionLocY * (uint)Constants.RegionSize); // LLY responseMap["region_id"] = LLSD.FromUUID(reg.originRegionID); responseMap["sim_access"] = LLSD.FromString((reg.RegionSettings.Maturity == 1) ? "Mature" : "PG"); - + // Generate a dummy agent for the user so we can get back a CAPS path AgentCircuitData agentData = new AgentCircuitData(); agentData.AgentID = LocalAgentID; @@ -299,7 +292,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid useragent.SecureSessionID=agentData.SecureSessionID; useragent.SessionID = agentData.SessionID; - UserProfileData userProfile = new UserProfileData(); userProfile.AboutText = "OGP User"; userProfile.CanDoMask = (uint)0; @@ -338,15 +330,13 @@ namespace OpenSim.Region.Environment.Modules.InterGrid // Do caps registration // get seed cap - - + // Stick our data in the cache so the region will know something about us homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile); // Call 'new user' event handler homeScene.NewUserConnection(reg.RegionHandle, agentData); - //string raCap = string.Empty; LLUUID AvatarRezCapUUID = LLUUID.Random(); @@ -379,16 +369,16 @@ namespace OpenSim.Region.Environment.Modules.InterGrid public LLSD RezAvatarMethod(string path, LLSD request) { m_log.WarnFormat("[REZAVATAR]: {0}", request.ToString()); - + LLSDMap responseMap = new LLSDMap(); - + AgentCircuitData userData = null; - + // Only people we've issued a cap can go further if (TryGetAgentCircuitData(path,out userData)) { LLSDMap requestMap = (LLSDMap)request; - + // take these values to start. There's a few more LLUUID SecureSessionID=requestMap["secure_session_id"].AsUUID(); LLUUID SessionID = requestMap["session_id"].AsUUID(); @@ -419,7 +409,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid if (item.ContainsKey("parent_estate_id")) { parentEstateID = item["parent_estate_id"].AsInteger(); - + } if (item.ContainsKey("region_id")) { @@ -437,11 +427,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid // Locate a home scene suitable for the user. Scene homeScene = GetRootScene(); - + if (homeScene != null) { // Get a reference to their Cap object so we can pull out the capobjectroot - OpenSim.Framework.Communications.Capabilities.Caps userCap = + OpenSim.Framework.Communications.Capabilities.Caps userCap = homeScene.GetCapsHandlerForUser(userData.AgentID); //Update the circuit data in the region so this user is authorized @@ -470,7 +460,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid userState.region_id = regionID; userState.src_parent_estate_id = parentEstateID; userState.visible_to_parent = visibleToParent; - + // Save state changes UpdateOGPState(userData.AgentID, userState); @@ -481,8 +471,8 @@ namespace OpenSim.Region.Environment.Modules.InterGrid LLSDArray PositionArray = new LLSDArray(); PositionArray.Add(LLSD.FromInteger(128)); PositionArray.Add(LLSD.FromInteger(128)); - PositionArray.Add(LLSD.FromInteger(40)); - + PositionArray.Add(LLSD.FromInteger(40)); + LLSDArray LookAtArray = new LLSDArray(); LookAtArray.Add(LLSD.FromInteger(1)); LookAtArray.Add(LLSD.FromInteger(1)); @@ -503,44 +493,36 @@ namespace OpenSim.Region.Environment.Modules.InterGrid responseMap["seed_capability"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); responseMap["region"] = LLSD.FromUUID(reg.originRegionID); responseMap["look_at"] = LookAtArray; - + responseMap["sim_port"] = LLSD.FromInteger(reg.InternalEndPoint.Port); responseMap["sim_host"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString());// + ":" + reg.InternalEndPoint.Port.ToString()); responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); - + responseMap["session_id"] = LLSD.FromUUID(SessionID); responseMap["secure_session_id"] = LLSD.FromUUID(SecureSessionID); responseMap["circuit_code"] = LLSD.FromInteger(circuitcode); - + responseMap["position"] = PositionArray; - + responseMap["region_id"] = LLSD.FromUUID(reg.originRegionID); - + responseMap["sim_access"] = LLSD.FromString("Mature"); - + responseMap["connect"] = LLSD.FromBoolean(true); m_log.InfoFormat("[OGP]: host: {0}, IP {1}", responseMap["sim_host"].ToString(), responseMap["sim_ip"].ToString()); - } - } - return responseMap; + return responseMap; } - - public LLSD DerezAvatarMethod(string path, LLSD request) { - - m_log.ErrorFormat("DerezPath: {0}, Request: {1}", path, request.ToString()); - + //LLSD llsdResponse = null; LLSDMap responseMap = new LLSDMap(); - - string[] PathArray = path.Split('/'); m_log.InfoFormat("[OGP]: prefix {0}, uuid {1}, suffix {2}", PathArray[1], PathArray[2], PathArray[3]); @@ -549,17 +531,15 @@ namespace OpenSim.Region.Environment.Modules.InterGrid LLUUID userUUID = LLUUID.Zero; if (Helpers.TryParse(uuidString, out userUUID)) { - LLUUID RemoteID = uuidString; LLUUID LocalID = RemoteID; // FIXME: TODO: Routine to map RemoteUUIDs to LocalUUIds - // would be done already.. but the client connects with the Aditi UUID + // would be done already.. but the client connects with the Aditi UUID // regardless over the UDP stack OGPState userState = GetOGPState(LocalID); if (userState.agent_id != LLUUID.Zero) { - //LLSDMap outboundRequestMap = new LLSDMap(); LLSDMap inboundRequestMap = (LLSDMap)request; string rezAvatarString = inboundRequestMap["rez_avatar"].AsString(); @@ -569,12 +549,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid LookAtArray.Add(LLSD.FromInteger(1)); LookAtArray.Add(LLSD.FromInteger(1)); - LLSDArray PositionArray = new LLSDArray(); PositionArray.Add(LLSD.FromInteger(128)); PositionArray.Add(LLSD.FromInteger(128)); PositionArray.Add(LLSD.FromInteger(40)); - + LLSDArray lookArray = new LLSDArray(); lookArray.Add(LLSD.FromInteger(128)); lookArray.Add(LLSD.FromInteger(128)); @@ -582,11 +561,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid responseMap["connect"] = LLSD.FromBoolean(true);// it's okay to give this user up responseMap["look_at"] = LookAtArray; - + m_log.WarnFormat("[OGP]: Invoking rez_avatar on host:{0} for avatar: {1} {2}", rezAvatarString, userState.first_name, userState.last_name); LLSDMap rezResponseMap = invokeRezAvatarCap(responseMap, rezAvatarString,userState); - + // If invoking it returned an error, parse and end if (rezResponseMap.ContainsKey("connect")) { @@ -599,17 +578,16 @@ namespace OpenSim.Region.Environment.Modules.InterGrid string rezRespSeedCap = rezResponseMap["seed_capability"].AsString(); string rezRespSim_ip = rezResponseMap["sim_ip"].AsString(); string rezRespSim_host = rezResponseMap["sim_host"].AsString(); - + int rrPort = rezResponseMap["sim_port"].AsInteger(); int rrX = rezResponseMap["region_x"].AsInteger(); int rrY = rezResponseMap["region_y"].AsInteger(); m_log.ErrorFormat("X:{0}, Y:{1}", rrX, rrY); LLUUID rrRID = rezResponseMap["region_id"].AsUUID(); - + string rrAccess = rezResponseMap["sim_access"].AsString(); - + LLSDArray RezResponsePositionArray = (LLSDArray)rezResponseMap["position"]; - responseMap["seed_capability"] = LLSD.FromString(rezRespSeedCap); responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString()); @@ -619,23 +597,17 @@ namespace OpenSim.Region.Environment.Modules.InterGrid responseMap["region_y"] = LLSD.FromInteger(rrY ); responseMap["region_id"] = LLSD.FromUUID(rrRID); responseMap["sim_access"] = LLSD.FromString(rrAccess); - - - responseMap["position"] = RezResponsePositionArray; responseMap["look_at"] = lookArray; responseMap["connect"] = LLSD.FromBoolean(true); ShutdownConnection(LocalID,this); - m_log.Warn("RESPONSEDEREZ: " + responseMap.ToString()); return responseMap; - } - else + else { - return GenerateNoHandlerMessage(); } } @@ -649,20 +621,18 @@ namespace OpenSim.Region.Environment.Modules.InterGrid private LLSDMap invokeRezAvatarCap(LLSDMap responseMap, string CapAddress, OGPState userState) { - Scene reg = GetRootScene(); WebRequest DeRezRequest = WebRequest.Create(CapAddress); DeRezRequest.Method = "POST"; DeRezRequest.ContentType = "application/xml+llsd"; - LLSDMap RAMap = new LLSDMap(); LLSDMap AgentParms = new LLSDMap(); LLSDMap RegionParms = new LLSDMap(); - + LLSDArray Parameter = new LLSDArray(2); - + LLSDMap version = new LLSDMap(); version["version"] = LLSD.FromInteger(userState.src_version); Parameter.Add((LLSD)version); @@ -673,7 +643,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid SrcData["region_id"] = LLSD.FromUUID(reg.RegionInfo.originRegionID); SrcData["visible_to_parent"] = LLSD.FromBoolean(userState.visible_to_parent); Parameter.Add((LLSD)SrcData); - + AgentParms["first_name"] = LLSD.FromString(userState.first_name); AgentParms["last_name"] = LLSD.FromString(userState.last_name); AgentParms["agent_id"] = LLSD.FromUUID(userState.agent_id); @@ -689,13 +659,12 @@ namespace OpenSim.Region.Environment.Modules.InterGrid AgentParms["age_verified"] = LLSD.FromBoolean(userState.age_verified); AgentParms["limited_to_estate"] = LLSD.FromInteger(userState.limited_to_estate); AgentParms["inventory_host"] = LLSD.FromString(userState.inventory_host); - - // version 1 + + // version 1 RAMap = AgentParms; - + // Planned for version 2 // RAMap["agent_params"] = AgentParms; - RAMap["region_params"] = RegionParms; RAMap["parameter"] = Parameter; @@ -770,15 +739,13 @@ namespace OpenSim.Region.Environment.Modules.InterGrid return responseMap; } - - public LLSD GenerateNoHandlerMessage() { LLSDMap map = new LLSDMap(); map["reason"] = LLSD.FromString("LLSDRequest"); map["message"] = LLSD.FromString("No handler registered for LLSD Requests"); map["login"] = LLSD.FromString("false"); - + return map; } @@ -802,7 +769,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid CapsLoginID.Remove(path); } - private Scene GetRootScene() { Scene ReturnScene = null; @@ -815,9 +781,8 @@ namespace OpenSim.Region.Environment.Modules.InterGrid } return ReturnScene; - } - + private ulong GetOSCompatibleRegionHandle(RegionInfo reg) { return Util.UIntsToLong(reg.RegionLocX, reg.RegionLocY); @@ -849,7 +814,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid returnState.src_version = 1; returnState.src_parent_estate_id = 1; returnState.visible_to_parent = true; - + return returnState; } @@ -871,9 +836,10 @@ namespace OpenSim.Region.Environment.Modules.InterGrid public void DeleteOGPState(LLUUID agentId) { lock (m_OGPState) + { if (m_OGPState.ContainsKey(agentId)) m_OGPState.Remove(agentId); - + } } private void UpdateOGPState(LLUUID agentId, OGPState state) @@ -884,12 +850,13 @@ namespace OpenSim.Region.Environment.Modules.InterGrid { m_OGPState[agentId] = state; } - else + else { m_OGPState.Add(agentId,state); } } } + public void ShutdownConnection(LLUUID avatarId, OpenGridProtocolModule mod) { Scene homeScene = GetRootScene(); @@ -903,22 +870,17 @@ namespace OpenSim.Region.Environment.Modules.InterGrid ta.Start(); } } + // Temporary hack to allow teleporting to and from Vaak private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error) { - //if (cert.Subject == "E=root@lindenlab.com, CN=*.vaak.lindenlab.com, O=\"Linden Lab, Inc.\", L=San Francisco, S=California, C=US") //{ - return true; - //} //return false; - } - - } public class KillAUser @@ -944,7 +906,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid avToBeKilled.ControllingClient.SendLogoutPacketWhenClosing = false; Thread.Sleep(30000); - + // test for child agent because they might have come back if (avToBeKilled.IsChildAgent) { @@ -953,12 +915,10 @@ namespace OpenSim.Region.Environment.Modules.InterGrid } } } - } + public class MonoCert : ICertificatePolicy { - - #region ICertificatePolicy Members public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem) diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs index 5e22e57..0b68c5f 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs @@ -59,7 +59,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. /// public static readonly string TERRAINS_PATH = "terrains/"; - + /// /// The character the separates the uuid from extension information in an archived asset filename /// diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 201986e..89f5fd7 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs @@ -212,16 +212,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver // Right now we're nastily obtaining the lluuid from the filename string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR); - + if (i == -1) { m_log.ErrorFormat( "[ARCHIVER]: Could not find extension information in asset path {0} since it's missing the separator {1}. Skipping", assetPath, ArchiveConstants.ASSET_EXTENSION_SEPARATOR); - + return false; } - + string extension = filename.Substring(i); string uuid = filename.Remove(filename.Length - extension.Length); diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 2d27b11..c1f5566 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -315,13 +315,13 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public event RegionHandleRequest OnRegionHandleRequest; public event ParcelInfoRequest OnParcelInfoRequest; - public event ActivateGesture OnActivateGesture; + public event ActivateGesture OnActivateGesture; public event DeactivateGesture OnDeactivateGesture; #pragma warning restore 67 #endregion - + public void ActivateGesture(LLUUID assetId, LLUUID gestureId) { } diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs index 2ae4174..bfb5016 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs @@ -103,7 +103,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap Bitmap mapbmp = new Bitmap(256, 256); //long t = System.Environment.TickCount; - //for(int i = 0; i < 10; ++i) { + //for (int i = 0; i < 10; ++i) { terrainRenderer.TerrainToBitmap(mapbmp); //} //t = System.Environment.TickCount - t; diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs index 253a7f5..1ee86ba 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs @@ -97,8 +97,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // No, that doesn't scale it: // heightvalue = low + mid * (heightvalue - low) / mid; => low + (heightvalue - low) * mid / mid = low + (heightvalue - low) * 1 = low + heightvalue - low = heightvalue - - if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue)) heightvalue = 0; else if (heightvalue > 255f) @@ -136,7 +134,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap int hfdiffi = 0; int hfdiffihighlight = 0; float highlightfactor = 0.18f; - + try { // hfdiffi = Math.Abs((int)((hfdiff * 4) + (hfdiff * 0.5))) + 1; @@ -146,7 +144,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // hfdiffi = hfdiffi + Math.Abs((int)(((hfdiff % 1) * 0.5f) * 10f) - 1); hfdiffi = hfdiffi + Math.Abs((int)((hfdiff % 1f) * 5f) - 1); } - + hfdiffihighlight = Math.Abs((int)((hfdiff * highlightfactor) * 4.5f)) + 1; if (hfdiff % 1f != 0) { @@ -195,10 +193,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap color = Color.FromArgb((r - hfdiffi > 0) ? r - hfdiffi : 0, (g - hfdiffi > 0) ? g - hfdiffi : 0, (b - hfdiffi > 0) ? b - hfdiffi : 0); - + mapbmp.SetPixel(x-1, yr+1, color); } - } } } @@ -213,7 +210,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap color = Color.Black; mapbmp.SetPixel(x, yr, color); } - } else { diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs index 957a1df..615befc 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs @@ -82,10 +82,10 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // (for info about algorithm, see http://en.wikipedia.org/wiki/HSL_and_HSV) public Color toColor() { - if(s < 0f) Console.WriteLine("S < 0: " + s); - else if(s > 1f) Console.WriteLine("S > 1: " + s); - if(v < 0f) Console.WriteLine("V < 0: " + v); - else if(v > 1f) Console.WriteLine("V > 1: " + v); + if (s < 0f) Console.WriteLine("S < 0: " + s); + else if (s > 1f) Console.WriteLine("S > 1: " + s); + if (v < 0f) Console.WriteLine("V < 0: " + v); + else if (v > 1f) Console.WriteLine("V > 1: " + v); float f = h / 60f; int sector = (int)f % 6; @@ -95,7 +95,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap int ti = (int)(v * (1f - (1f - f) * s) * 255f); int vi = (int)(v * 255f); - switch(sector) + switch (sector) { case 0: return Color.FromArgb(vi, ti, pi); @@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap { AssetBase asset = m_scene.AssetCache.GetAsset(id, true); m_log.DebugFormat("Fetched texture {0}, found: {1}", id, asset != null); - if(asset == null) return null; + if (asset == null) return null; return new Bitmap(OpenJPEG.DecodeToImage(asset.Data)); } @@ -179,9 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // color-channel, so 2^24 is the maximum value we can get, adding everything. // int is be big enough for that. int r = 0, g = 0, b = 0; - for(int y = 0; y < bmp.Height; ++y) + for (int y = 0; y < bmp.Height; ++y) { - for(int x = 0; x < bmp.Width; ++x) + for (int x = 0; x < bmp.Width; ++x) { Color c = bmp.GetPixel(x, y); r += (int)c.R & 0xff; @@ -218,14 +218,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // interpolate two colors in HSV space and return the resulting color private HSV interpolateHSV(ref HSV c1, ref HSV c2, float ratio) { - if(ratio <= 0f) return c1; - if(ratio >= 1f) return c2; + if (ratio <= 0f) return c1; + if (ratio >= 1f) return c2; // make sure we are on the same side on the hue-circle for interpolation // We change the hue of the parameters here, but we don't change the color // represented by that value - if(c1.h - c2.h > 180f) c1.h -= 360f; - else if(c2.h - c1.h > 180f) c1.h += 360f; + if (c1.h - c2.h > 180f) c1.h -= 360f; + else if (c2.h - c1.h > 180f) c1.h += 360f; return new HSV(c1.h * (1f - ratio) + c2.h * ratio, c1.s * (1f - ratio) + c2.s * ratio, @@ -321,16 +321,16 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } HSV hsv; - if(hmod <= low) hsv = hsv1; // too low - else if(hmod >= high) hsv = hsv4; // too high + if (hmod <= low) hsv = hsv1; // too low + else if (hmod >= high) hsv = hsv4; // too high else { // HSV-interpolate along the colors // first, rescale h to 0.0 - 1.0 hmod = (hmod - low) / (high - low); // now we have to split: 0.00 => color1, 0.33 => color2, 0.67 => color3, 1.00 => color4 - if(hmod < 1f/3f) hsv = interpolateHSV(ref hsv1, ref hsv2, hmod * 3f); - else if(hmod < 2f/3f) hsv = interpolateHSV(ref hsv2, ref hsv3, (hmod * 3f) - 1f); + if (hmod < 1f/3f) hsv = interpolateHSV(ref hsv1, ref hsv2, hmod * 3f); + else if (hmod < 2f/3f) hsv = interpolateHSV(ref hsv2, ref hsv3, (hmod * 3f) - 1f); else hsv = interpolateHSV(ref hsv3, ref hsv4, (hmod * 3f) - 2f); } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 424c56c..0bd0028 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -276,8 +276,6 @@ namespace OpenSim.Region.Environment.Scenes if (m_storageManager.EstateDataStore != null) m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID); - - //Bind Storage Manager functions to some land manager functions for this scene EventManager.OnLandObjectAdded += new EventManager.LandObjectAdded(m_storageManager.DataStore.StoreLandObject); @@ -322,7 +320,6 @@ namespace OpenSim.Region.Environment.Scenes { m_log.Warn("Failed to load StartupConfig"); } - } #endregion @@ -351,7 +348,6 @@ namespace OpenSim.Region.Environment.Scenes // we add it to the notify list regardless of distance. // We'll check the agent's draw distance before notifying them though. - if (RegionInfo.RegionHandle != otherRegion.RegionHandle) { for (int i = 0; i < m_neighbours.Count; i++) @@ -386,8 +382,7 @@ namespace OpenSim.Region.Environment.Scenes int resultX = Math.Abs((int)otherRegion.RegionLocX - (int)RegionInfo.RegionLocX); int resultY = Math.Abs((int)otherRegion.RegionLocY - (int)RegionInfo.RegionLocY); - if ((resultX <= 1) && - (resultY <= 1)) + if (resultX <= 1 && resultY <= 1) { try { @@ -584,8 +579,6 @@ namespace OpenSim.Region.Environment.Scenes } } } - - } m_scripts_enabled = !ScriptEngine; m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine"); @@ -600,7 +593,9 @@ namespace OpenSim.Region.Environment.Scenes public int GetInaccurateNeighborCount() { lock (m_neighbours) + { return m_neighbours.Count; + } } // This is the method that shuts down the scene. @@ -1062,7 +1057,6 @@ namespace OpenSim.Region.Environment.Scenes float hfdiff = hfvalue; int hfdiffi = 0; - for (int x = 0; x < 256; x++) { //int tc = System.Environment.TickCount; @@ -1087,10 +1081,8 @@ namespace OpenSim.Region.Environment.Scenes //float tmpval = (float)hm[x, y]; float heightvalue = (float)hm[x, y]; - if (heightvalue > (float)m_regInfo.RegionSettings.WaterHeight) { - // scale height value heightvalue = low + mid * (heightvalue - low) / mid; @@ -1102,6 +1094,7 @@ namespace OpenSim.Region.Environment.Scenes if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue)) heightvalue = 0; + try { Color green = Color.FromArgb((int)heightvalue, 100, (int)heightvalue); @@ -1136,7 +1129,6 @@ namespace OpenSim.Region.Environment.Scenes // we use floats, colors use bytes, so shrink are space down to // 0-255 - try { hfdiffi = Math.Abs((int)((hfdiff * 4) + (hfdiff * 0.5))) + 1; @@ -1166,15 +1158,8 @@ namespace OpenSim.Region.Environment.Scenes mapbmp.SetPixel(x - 1, (256 - y) - 1, Shade); } } - - } - } - - - - } catch (System.ArgumentException) { @@ -1264,7 +1249,6 @@ namespace OpenSim.Region.Environment.Scenes if (part == null) continue; - // Draw if the object is at least 1 meter wide in any direction if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f) { @@ -1426,6 +1410,7 @@ namespace OpenSim.Region.Environment.Scenes } } } + public void LazySaveGeneratedMaptile(byte[] data, bool temporary) { // Overwrites the local Asset cache with new maptile data @@ -1482,6 +1467,7 @@ namespace OpenSim.Region.Environment.Scenes asset.Temporary = temporary; AssetCache.AddAsset(asset); } + #endregion #region Load Land @@ -1556,6 +1542,7 @@ namespace OpenSim.Region.Environment.Scenes pos = RayEnd; return pos; } + if (RayTargetID != LLUUID.Zero) { SceneObjectPart target = GetSceneObjectPart(RayTargetID); @@ -1921,9 +1908,7 @@ namespace OpenSim.Region.Environment.Scenes if (position.X > Constants.RegionSize + 0.1f) { pos.X = ((pos.X - Constants.RegionSize)); - newRegionHandle = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), (uint)(thisy * Constants.RegionSize)); - // x + 1 } else if (position.X < -0.1f) @@ -2165,9 +2150,7 @@ namespace OpenSim.Region.Environment.Scenes client.OnScriptReset += ProcessScriptReset; client.OnGetScriptRunning += GetScriptRunning; client.OnSetScriptRunning += SetScriptRunning; - client.OnRegionHandleRequest += RegionHandleRequest; - client.OnUnackedTerrain += TerrainUnAcked; //Gesture @@ -2185,7 +2168,6 @@ namespace OpenSim.Region.Environment.Scenes if (userInfo != null) { - InventoryItemBase item = userInfo.RootFolder.FindItem(gestureId); if (item != null) { @@ -2206,7 +2188,6 @@ namespace OpenSim.Region.Environment.Scenes if (userInfo != null) { - InventoryItemBase item = userInfo.RootFolder.FindItem(gestureId); if (item != null) { @@ -2607,7 +2588,6 @@ namespace OpenSim.Region.Environment.Scenes "[CONNECTION DEBUGGING]: Skipping this region for welcoming avatar {0} [{1}] at {2}", agent.AgentID, regionHandle, RegionInfo.RegionName); } - } public void UpdateCircuitData(AgentCircuitData data) @@ -2645,9 +2625,8 @@ namespace OpenSim.Region.Environment.Scenes m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString()); } } - - } + /// /// Add a caps handler for the given agent. If the CAPS handler already exists for this agent, /// then it is replaced by a new CAPS handler. @@ -2905,14 +2884,14 @@ namespace OpenSim.Region.Environment.Scenes public void RequestTeleportLandmark(IClientAPI remoteClient, LLUUID regionID, LLVector3 position) { RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(regionID); - + if (info == null) { // can't find the region: Tell viewer and abort remoteClient.SendTeleportFailed("The teleport destination could not be found."); return; } - + lock (m_scenePresences) { if (m_scenePresences.ContainsKey(remoteClient.AgentId)) @@ -3016,7 +2995,6 @@ namespace OpenSim.Region.Environment.Scenes m_statsReporter.SetObjectCapacity(objects); } objectCapacity = objects; - } public List GetFriendList(LLUUID avatarID) @@ -3089,7 +3067,6 @@ namespace OpenSim.Region.Environment.Scenes return LLUUID.Zero; } - /// /// This method is a way for the Friends Module to create an instant /// message to the avatar and for Instant Messages that travel across @@ -3105,7 +3082,6 @@ namespace OpenSim.Region.Environment.Scenes m_eventManager.TriggerGridInstantMessage(message, options); } - public virtual void StoreAddFriendship(LLUUID ownerID, LLUUID friendID, uint perms) { // TODO: m_sceneGridService.DoStuff; @@ -3123,6 +3099,7 @@ namespace OpenSim.Region.Environment.Scenes // TODO: m_sceneGridService.DoStuff; m_sceneGridService.RemoveUserFriend(ownerID, ExfriendID); } + public virtual List StoreGetFriendsForUser(LLUUID ownerID) { // TODO: m_sceneGridService.DoStuff; @@ -3135,11 +3112,13 @@ namespace OpenSim.Region.Environment.Scenes m_statsReporter.AddOutPackets(outPackets); m_statsReporter.AddunAckedBytes(unAckedBytes); } + public void AddAgentTime(int ms) { m_statsReporter.addFrameMS(ms); m_statsReporter.addAgentMS(ms); } + public void AddAgentUpdates(int count) { m_statsReporter.AddAgentUpdates(count); @@ -3239,7 +3218,6 @@ namespace OpenSim.Region.Environment.Scenes /// The Message being sent to the user public void SendRegionMessageFromEstateTools(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) { - List presenceList = GetScenePresences(); foreach (ScenePresence presence in presenceList) @@ -3359,7 +3337,7 @@ namespace OpenSim.Region.Environment.Scenes foreach (ScenePresence presence in presenceList) { - if ((presence.Firstname == firstName) && (presence.Lastname == lastName)) + if (presence.Firstname == firstName && presence.Lastname == lastName) { presence.ControllingClient.SendAgentAlertMessage(message, modal); break; @@ -3876,7 +3854,6 @@ namespace OpenSim.Region.Environment.Scenes return m_httpListener.AddLLSDHandler(path, handler); } - public void RemoveStreamHandler(string httpMethod, string path) { m_httpListener.RemoveStreamHandler(httpMethod, path); @@ -3945,7 +3922,6 @@ namespace OpenSim.Region.Environment.Scenes client.SendRegionHandle(regionID, info.RegionHandle); } - public void TerrainUnAcked(IClientAPI client, int patchX, int patchY) { //Console.WriteLine("Terrain packet unacked, resending patch: " + patchX + " , " + patchY); @@ -3973,10 +3949,10 @@ namespace OpenSim.Region.Environment.Scenes public void ObjectSaleInfo(IClientAPI client, LLUUID agentID, LLUUID sessionID, uint localID, byte saleType, int salePrice) { SceneObjectPart part = GetSceneObjectPart(localID); - if(part == null || part.ParentGroup == null) + if (part == null || part.ParentGroup == null) return; - if(part.ParentGroup.RootPart == null) + if (part.ParentGroup.RootPart == null) return; part = part.ParentGroup.RootPart; @@ -3994,10 +3970,10 @@ namespace OpenSim.Region.Environment.Scenes { SceneObjectPart part = GetSceneObjectPart(localID); - if(part == null) + if (part == null) return; - if(part.ParentGroup == null) + if (part.ParentGroup == null) return; SceneObjectGroup group = part.ParentGroup; diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 24f814e..f8c5814 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -636,7 +636,7 @@ namespace OpenSim.Region.Environment.Scenes // both regions if (avatar.ParentID != (uint)0) avatar.StandUp(); - if(!avatar.ValidateAttachments()) + if (!avatar.ValidateAttachments()) { avatar.ControllingClient.SendTeleportFailed("Inconsistent attachment state"); return; diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index cf24c73..4b785e9 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -2350,10 +2350,10 @@ namespace OpenSim.Region.Environment.Scenes // Validate foreach (SceneObjectGroup gobj in m_attachments) { - if(gobj == null) + if (gobj == null) return false; - if(gobj.RootPart == null) + if (gobj.RootPart == null) { return false; } @@ -2370,7 +2370,7 @@ namespace OpenSim.Region.Environment.Scenes // Validate foreach (SceneObjectGroup gobj in m_attachments) { - if(gobj == null || gobj.RootPart == null) + if (gobj == null || gobj.RootPart == null) return false; } diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs index 394dcf3..4630d98 100644 --- a/OpenSim/Region/Physics/Meshing/Mesh.cs +++ b/OpenSim/Region/Physics/Meshing/Mesh.cs @@ -231,7 +231,7 @@ namespace OpenSim.Region.Physics.Meshing { int[] result = getIndexListAsInt(); pinnedIndex = GCHandle.Alloc(result, GCHandleType.Pinned); - + return result; } diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index a66a1b1..7cf8b76 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -1890,9 +1890,9 @@ namespace OpenSim.Region.Physics.Meshing else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.HalfCircle) { // half circle, prim is a sphere sides = 24; - - profileBegin = 0.5f * profileBegin + 0.5f; - profileEnd = 0.5f * profileEnd + 0.5f; + + profileBegin = 0.5f * profileBegin + 0.5f; + profileEnd = 0.5f * profileEnd + 0.5f; //profileHollow = 0.0f; // debugging only } @@ -1904,7 +1904,6 @@ namespace OpenSim.Region.Physics.Meshing hollowSides = 4; else if (primShape.HollowShape == HollowShape.Triangle) hollowSides = 3; - PrimMesh primMesh = new PrimMesh(sides, profileBegin, profileEnd, profileHollow, hollowSides); //PrimMesh primMesh = new PrimMesh(sides, profileBegin, profileEnd, 0.0f, 4); diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/Physics/Meshing/PrimMesher.cs index 53cc443..58bb82e 100644 --- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs +++ b/OpenSim/Region/Physics/Meshing/PrimMesher.cs @@ -99,8 +99,8 @@ namespace OpenSim.Region.Physics.Meshing internal List angles; // this class should have a table of most commonly computed values - // instead of all the trig function calls - // most common would be for sides = 3, 4, or 24 + // instead of all the trig function calls + // most common would be for sides = 3, 4, or 24 internal void makeAngles( int sides, float startAngle, float stopAngle ) { angles = new List(); @@ -134,7 +134,7 @@ namespace OpenSim.Region.Physics.Meshing newAngle.Y = (float) System.Math.Sin(angle); angles.Add(newAngle); step += 1; - angle = stepSize * step; + angle = stepSize * step; } if (startAngle > angles[0].angle) @@ -187,15 +187,15 @@ namespace OpenSim.Region.Physics.Meshing AngleList hollowAngles = new AngleList(); float xScale = 0.5f; - float yScale = 0.5f; + float yScale = 0.5f; if (sides == 4) // corners of a square are sqrt(2) from center - { + { xScale = 0.707f; - yScale = 0.707f; + yScale = 0.707f; } float startAngle = profileStart * twoPi; - float stopAngle = profileEnd * twoPi; + float stopAngle = profileEnd * twoPi; float stepSize = twoPi / sides; try { angles.makeAngles(sides, startAngle, stopAngle); } @@ -397,7 +397,7 @@ namespace OpenSim.Region.Physics.Meshing { vert = this.coords[i]; Vertex v = new Vertex(vert.X, vert.Y, vert.Z) * q; - + vert.X = v.X; vert.Y = v.Y; vert.Z = v.Z; @@ -507,23 +507,23 @@ namespace OpenSim.Region.Physics.Meshing s += "sides..................: " + this.sides.ToString(); s += "\nhollowSides..........: " + this.hollowSides.ToString(); s += "\nprofileStart.........: " + this.profileStart.ToString(); - s += "\nprofileEnd...........: " + this.profileEnd.ToString(); - s += "\nhollow...............: " + this.hollow.ToString(); - s += "\ntwistBegin...........: " + this.twistBegin.ToString(); - s += "\ntwistEnd.............: " + this.twistEnd.ToString(); - s += "\ntopShearX............: " + this.topShearX.ToString(); - s += "\ntopShearY............: " + this.topShearY.ToString(); - s += "\npathCutBegin.........: " + this.pathCutBegin.ToString(); - s += "\npathCutEnd...........: " + this.pathCutEnd.ToString(); - s += "\ndimpleBegin..........: " + this.dimpleBegin.ToString(); - s += "\ndimpleEnd............: " + this.dimpleEnd.ToString(); - s += "\nskew.................: " + this.skew.ToString(); - s += "\nholeSizeX............: " + this.holeSizeX.ToString(); - s += "\nholeSizeY............: " + this.holeSizeY.ToString(); - s += "\ntaperX...............: " + this.taperX.ToString(); - s += "\ntaperY...............: " + this.taperY.ToString(); - s += "\nradius...............: " + this.radius.ToString(); - s += "\nrevolutions..........: " + this.revolutions.ToString(); + s += "\nprofileEnd...........: " + this.profileEnd.ToString(); + s += "\nhollow...............: " + this.hollow.ToString(); + s += "\ntwistBegin...........: " + this.twistBegin.ToString(); + s += "\ntwistEnd.............: " + this.twistEnd.ToString(); + s += "\ntopShearX............: " + this.topShearX.ToString(); + s += "\ntopShearY............: " + this.topShearY.ToString(); + s += "\npathCutBegin.........: " + this.pathCutBegin.ToString(); + s += "\npathCutEnd...........: " + this.pathCutEnd.ToString(); + s += "\ndimpleBegin..........: " + this.dimpleBegin.ToString(); + s += "\ndimpleEnd............: " + this.dimpleEnd.ToString(); + s += "\nskew.................: " + this.skew.ToString(); + s += "\nholeSizeX............: " + this.holeSizeX.ToString(); + s += "\nholeSizeY............: " + this.holeSizeY.ToString(); + s += "\ntaperX...............: " + this.taperX.ToString(); + s += "\ntaperY...............: " + this.taperY.ToString(); + s += "\nradius...............: " + this.radius.ToString(); + s += "\nrevolutions..........: " + this.revolutions.ToString(); s += "\nstepsPerRevolution...: " + this.stepsPerRevolution.ToString(); return s; @@ -542,20 +542,20 @@ namespace OpenSim.Region.Physics.Meshing this.hollowSides = hollowSides; if (sides < 3) - this.sides = 3; + this.sides = 3; if ( hollowSides < 3) - this.hollowSides = 3; - if (profileStart < 0.0f) + this.hollowSides = 3; + if (profileStart < 0.0f) this.profileStart = 0.0f; - if (profileEnd > 1.0f) + if (profileEnd > 1.0f) this.profileEnd = 1.0f; - if (profileEnd < 0.02f) + if (profileEnd < 0.02f) this.profileEnd = 0.02f; - if (profileStart >= profileEnd) + if (profileStart >= profileEnd) this.profileStart = profileEnd - 0.02f; - if (hollow > 1.0f) + if (hollow > 1.0f) this.hollow = 1.0f; - if (hollow < 0.0f) + if (hollow < 0.0f) this.hollow = 0.0f; } @@ -578,7 +578,7 @@ namespace OpenSim.Region.Physics.Meshing steps = (int)(steps * 4.5 * length); } #endif - + float twistBegin = this.twistBegin / 360.0f * twoPi; float twistEnd = this.twistEnd / 360.0f * twoPi; float twistTotal = twistEnd - twistBegin; @@ -661,7 +661,7 @@ namespace OpenSim.Region.Physics.Meshing newLayer.AddValue2Faces(coordsLen); this.coords.AddRange(newLayer.coords); - this.faces.AddRange(newLayer.faces); + this.faces.AddRange(newLayer.faces); // fill faces between layers @@ -707,7 +707,6 @@ namespace OpenSim.Region.Physics.Meshing else done = true; } } - public void ExtrudeCircular() { @@ -721,9 +720,9 @@ namespace OpenSim.Region.Physics.Meshing float twistEnd = this.twistEnd / 360.0f * twoPi; float twistTotal = twistEnd - twistBegin; - // if the profile has a lot of twist, add more layers otherwise the layers may overlap - // and the resulting mesh may be quite inaccurate. This method is arbitrary and doesn't - // accurately match the viewer + // if the profile has a lot of twist, add more layers otherwise the layers may overlap + // and the resulting mesh may be quite inaccurate. This method is arbitrary and doesn't + // accurately match the viewer float twistTotalAbs = Math.Abs(twistTotal); if (twistTotalAbs > 0.01f) { @@ -732,19 +731,19 @@ namespace OpenSim.Region.Physics.Meshing if (twistTotalAbs > Math.PI * 3.0f) steps *= 2; } - + float yPathScale = this.holeSizeY * 0.5f; float pathLength = this.pathCutEnd - this.pathCutBegin; float totalSkew = this.skew * 2.0f * pathLength; float skewStart = this.pathCutBegin * 2.0f * this.skew - this.skew; // It's not quite clear what pushY (Y top shear) does, but subtracting it from the start and end - // angles appears to approximate it's effects on path cut. Likewise, adding it to the angle used - // to calculate the sine for generating the path radius appears to approximate it's effects there - // too, but there are some subtle differences in the radius which are noticeable as the prim size - // increases and it may affect megaprims quite a bit. The effect of the Y top shear parameter on - // the meshes generated with this technique appear nearly identical in shape to the same prims when - // displayed by the viewer. + // angles appears to approximate it's effects on path cut. Likewise, adding it to the angle used + // to calculate the sine for generating the path radius appears to approximate it's effects there + // too, but there are some subtle differences in the radius which are noticeable as the prim size + // increases and it may affect megaprims quite a bit. The effect of the Y top shear parameter on + // the meshes generated with this technique appear nearly identical in shape to the same prims when + // displayed by the viewer. float startAngle = (twoPi * this.pathCutBegin * this.revolutions) - this.topShearY * 0.9f; float endAngle = (twoPi * this.pathCutEnd * this.revolutions) - this.topShearY * 0.9f; @@ -784,7 +783,7 @@ namespace OpenSim.Region.Physics.Meshing hollow /= 0.7f; } } - + Profile profile = new Profile(this.sides, this.profileStart, this.profileEnd, hollow, this.hollowSides); if (initialProfileRot != 0.0f) @@ -834,7 +833,7 @@ namespace OpenSim.Region.Physics.Meshing newLayer.AddRot(new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist)); // now orient the rotation of the profile layer relative to it's position on the path - // adding taperY to the angle used to generate the quat appears to approximate the viewer + // adding taperY to the angle used to generate the quat appears to approximate the viewer newLayer.AddRot(new Quaternion(new Vertex(1.0f, 0.0f, 0.0f), angle + this.topShearY * 0.9f)); newLayer.AddPos(xOffset, yOffset, zOffset); @@ -959,7 +958,7 @@ namespace OpenSim.Region.Physics.Meshing sw.WriteLine(s); } - + sw.Close(); } } diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 9fdf3ce..f10a854 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -2296,7 +2296,7 @@ namespace OpenSim.Region.ScriptEngine.Common bool found = false; float dist = (float)llVecDist(llGetPos(), pos); - if(dist > m_distanceFactor * 10.0f) + if (dist > m_distanceFactor * 10.0f) return; // Instead of using return;, I'm using continue; because in our TaskInventory implementation @@ -6247,7 +6247,7 @@ namespace OpenSim.Region.ScriptEngine.Common switch (primType) { case BuiltIn_Commands_BaseClass.PRIM_TYPE_BOX: - case BuiltIn_Commands_BaseClass.PRIM_TYPE_CYLINDER: + case BuiltIn_Commands_BaseClass.PRIM_TYPE_CYLINDER: case BuiltIn_Commands_BaseClass.PRIM_TYPE_PRISM: res.Add(new LSL_Types.LSLInteger(Shape.ProfileCurve)); res.Add(new LSL_Types.Vector3(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0)); @@ -6298,10 +6298,10 @@ namespace OpenSim.Region.ScriptEngine.Common // vector tapera res.Add(new LSL_Types.Vector3(Shape.PathTaperX / 100.0, Shape.PathTaperY / 100.0, 0)); - // float revolutions, + // float revolutions, res.Add(new LSL_Types.LSLFloat(Shape.PathRevolutions / 50.0)); // needs fixing :( - // float radiusoffset, + // float radiusoffset, res.Add(new LSL_Types.LSLFloat(Shape.PathRadiusOffset / 100.0)); // float skew @@ -7014,10 +7014,10 @@ namespace OpenSim.Region.ScriptEngine.Common { case 5: // DATA_SIM_POS if (info == null) - { - // ScriptSleep(1000); - return LLUUID.Zero.ToString(); - } + { + // ScriptSleep(1000); + return LLUUID.Zero.ToString(); + } reply = new LSL_Types.Vector3( info.RegionLocX * Constants.RegionSize, info.RegionLocY * Constants.RegionSize, @@ -7031,10 +7031,10 @@ namespace OpenSim.Region.ScriptEngine.Common break; case 7: // DATA_SIM_RATING if (info == null) - { - // ScriptSleep(1000); - return LLUUID.Zero.ToString(); - } + { + // ScriptSleep(1000); + return LLUUID.Zero.ToString(); + } int access = info.RegionSettings.Maturity; if (access == 0) reply = "PG"; @@ -7047,18 +7047,18 @@ namespace OpenSim.Region.ScriptEngine.Common reply = m_ScriptEngine.World.GetSimulatorVersion(); break; default: - // ScriptSleep(1000); + // ScriptSleep(1000); return LLUUID.Zero.ToString(); // Raise no event } LLUUID rq = LLUUID.Random(); - LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. - m_Dataserver.RegisterRequest(m_localID, m_itemID, rq.ToString()); + LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. + m_Dataserver.RegisterRequest(m_localID, m_itemID, rq.ToString()); - m_ScriptEngine.m_ASYNCLSLCommandManager. - m_Dataserver.DataserverReply(rq.ToString(), reply); + m_ScriptEngine.m_ASYNCLSLCommandManager. + m_Dataserver.DataserverReply(rq.ToString(), reply); - // ScriptSleep(1000); + // ScriptSleep(1000); return tid.ToString(); } catch(Exception e) @@ -8041,12 +8041,12 @@ namespace OpenSim.Region.ScriptEngine.Common (line >= 0) && (line < notecardLines.Length)) { - // ScriptSleep(100); + // ScriptSleep(100); return notecardLines[line]; } else { - // ScriptSleep(100); + // ScriptSleep(100); return String.Empty; } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b48edfb..b5ca167 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2130,7 +2130,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { float dist = (float)llVecMag(llGetPos() - pos); - if(dist > m_ScriptDistanceFactor * 10.0f) + if (dist > m_ScriptDistanceFactor * 10.0f) return; m_host.AddScriptLPS(1); @@ -5735,8 +5735,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case (int)ScriptBaseClass.PRIM_POINT_LIGHT: if (remain < 5) return; - LSL_Types.LSLInteger light = new LSL_Types.LSLInteger(rules.Data[idx++].ToString()); - LSL_Types.Vector3 lightcolor =new LSL_Types.Vector3(rules.Data[idx++].ToString()); + LSL_Types.LSLInteger light = new LSL_Types.LSLInteger(rules.Data[idx++].ToString()); + LSL_Types.Vector3 lightcolor = new LSL_Types.Vector3(rules.Data[idx++].ToString()); float intensity = (float)Convert.ToDouble(rules.Data[idx++]); float radius = (float)Convert.ToDouble(rules.Data[idx++]); float falloff = (float)Convert.ToDouble(rules.Data[idx++]); @@ -6895,10 +6895,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { case 5: // DATA_SIM_POS if (info == null) - { - // ScriptSleep(1000); - return LLUUID.Zero.ToString(); - } + { + // ScriptSleep(1000); + return LLUUID.Zero.ToString(); + } reply = new LSL_Types.Vector3( info.RegionLocX * Constants.RegionSize, info.RegionLocY * Constants.RegionSize, @@ -6912,10 +6912,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case 7: // DATA_SIM_RATING if (info == null) - { - // ScriptSleep(1000); - return LLUUID.Zero.ToString(); - } + { + // ScriptSleep(1000); + return LLUUID.Zero.ToString(); + } int access = info.RegionSettings.Maturity; if (access == 0) reply = "PG"; @@ -6928,7 +6928,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api reply = m_ScriptEngine.World.GetSimulatorVersion(); break; default: - // ScriptSleep(1000); + // ScriptSleep(1000); return LLUUID.Zero.ToString(); // Raise no event } LLUUID rq = LLUUID.Random(); @@ -6939,7 +6939,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AsyncCommands. DataserverPlugin.DataserverReply(rq.ToString(), reply); - // ScriptSleep(1000); + // ScriptSleep(1000); return tid.ToString(); } catch(Exception e) @@ -7910,7 +7910,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AsyncCommands. DataserverPlugin.DataserverReply(item.AssetID.ToString(), NotecardCache.GetLines(item.AssetID).ToString()); - // ScriptSleep(100); + // ScriptSleep(100); return tid.ToString(); } WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a) @@ -7924,7 +7924,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api DataserverPlugin.DataserverReply(id.ToString(), NotecardCache.GetLines(id).ToString()); }); - // ScriptSleep(100); + // ScriptSleep(100); return tid.ToString(); } } @@ -7948,7 +7948,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AsyncCommands. DataserverPlugin.DataserverReply(item.AssetID.ToString(), NotecardCache.GetLine(item.AssetID, line)); - // ScriptSleep(100); + // ScriptSleep(100); return tid.ToString(); } WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a) @@ -7963,7 +7963,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api NotecardCache.GetLine(id, line)); }); - // ScriptSleep(100); + // ScriptSleep(100); return tid.ToString(); } } diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index 3a01dc6..d431286 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -89,7 +89,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine det[0].Key = remoteClient.AgentId; det[0].Populate(myScriptEngine.World); - if (originalID == 0) { SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID); @@ -103,7 +102,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine SceneObjectPart originalPart = myScriptEngine.World.GetSceneObjectPart(originalID); det[0].LinkNum = originalPart.LinkNum; } - + myScriptEngine.PostObjectEvent(localID, new EventParams( "touch_start", new Object[] { new LSL_Types.LSLInteger(1) }, det)); -- cgit v1.1