From be2ad79e52efb5eb543057e8e73fa601d0b91c87 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 20 Dec 2007 05:43:02 +0000 Subject: Added patch from Johan. First attempt to solve the LibSL.Packet GC problem. Works with LibSL rev>1532 --- OpenSim/Region/ClientStack/ClientView.cs | 37 +++++++----- .../Region/ClientStack/RegionApplicationBase.cs | 2 +- OpenSim/Region/ClientStack/UDPServer.cs | 65 +++++++++++++++++++++- .../Communications/Local/LocalBackEndServices.cs | 2 +- .../Communications/Local/LocalLoginService.cs | 10 ++-- .../Region/Communications/OGS1/OGS1GridServices.cs | 6 +- .../Communications/OGS1/OGS1InventoryService.cs | 2 +- .../Region/Communications/OGS1/OGS1UserServices.cs | 2 +- .../Region/Environment/Scenes/Scene.Inventory.cs | 2 +- OpenSim/Region/Environment/Scenes/Scene.cs | 11 ++-- .../Region/Environment/Scenes/SceneObjectPart.cs | 22 ++++---- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 6 +- .../Engines/CSharp/Examples/ExportRegionToLSL.cs | 4 +- .../Compiler/Server_API/LSL_BuiltIn_Commands.cs | 36 ++++-------- 14 files changed, 130 insertions(+), 77 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 75c4187..58cb9a2 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -535,7 +535,7 @@ namespace OpenSim.Region.ClientStack /// public void SendRegionHandshake(RegionInfo regionInfo) { - RegionHandshakePacket handshake = new RegionHandshakePacket(); + RegionHandshakePacket handshake = (RegionHandshakePacket) PacketPool.Instance.GetPacket(PacketType.RegionHandshake); handshake.RegionInfo.BillableFactor = regionInfo.EstateSettings.billableFactor; handshake.RegionInfo.IsEstateManager = false; @@ -2187,17 +2187,22 @@ namespace OpenSim.Region.ClientStack // Actually make the byte array and send it try { - byte[] sendbuffer = Pack.ToBytes(); - if (Pack.Header.Zerocoded) - { - byte[] ZeroOutBuffer = new byte[4096]; - int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); - m_networkServer.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, m_circuitCode); - } - else - { - m_networkServer.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, m_circuitCode); - } + byte[] sendbuffer = Pack.ToBytes(); + if (Pack is RegionHandshakePacket) + { + PacketPool.Instance.ReturnPacket(Pack); + } + + if (Pack.Header.Zerocoded) + { + byte[] ZeroOutBuffer = new byte[4096]; + int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); + m_networkServer.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, m_circuitCode); + } + else + { + m_networkServer.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, m_circuitCode); + } } catch (Exception e) { @@ -2801,7 +2806,7 @@ namespace OpenSim.Region.ClientStack case PacketType.AssetUploadRequest: AssetUploadRequestPacket request = (AssetUploadRequestPacket) Pack; // Console.WriteLine("upload request " + Pack.ToString()); - // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToStringHyphenated()); + // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); if (OnAssetUploadRequest != null) { LLUUID temp=libsecondlife.LLUUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); @@ -2928,7 +2933,7 @@ namespace OpenSim.Region.ClientStack AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionId)); if (asset != null) { - // Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToStringHyphenated() + " already in cache"); + // Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToString() + " already in cache"); m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); } else @@ -2936,7 +2941,7 @@ namespace OpenSim.Region.ClientStack asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID); if (asset != null) { - //Console.WriteLine("updating inventory item, adding asset" + asset.FullID.ToStringHyphenated() + " to cache"); + //Console.WriteLine("updating inventory item, adding asset" + asset.FullID.ToString() + " to cache"); m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); } else @@ -3351,6 +3356,8 @@ namespace OpenSim.Region.ClientStack #endregion } } + + PacketPool.Instance.ReturnPacket(Pack); } private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 51155ac..f20b132 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -134,7 +134,7 @@ namespace OpenSim.Region.ClientStack if (masterAvatar != null) { - m_log.Verbose("PARCEL", "Found master avatar [" + masterAvatar.UUID.ToStringHyphenated() + "]"); + m_log.Verbose("PARCEL", "Found master avatar [" + masterAvatar.UUID.ToString() + "]"); scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID; } else diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index f91e5e2..5cad041 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs @@ -26,6 +26,7 @@ * */ using System; +using System.Collections; using System.Collections.Generic; using System.Net; using System.Net.Sockets; @@ -36,6 +37,68 @@ using OpenSim.Framework.Console; namespace OpenSim.Region.ClientStack { + public sealed class PacketPool + { + // Set up a thread-safe singleton pattern + static PacketPool() + { + } + + static readonly PacketPool instance = new PacketPool(); + + public static PacketPool Instance + { + get + { + return instance; + } + } + + private Hashtable pool = new Hashtable(); + + public Packet GetPacket(PacketType type) { + Packet packet = null; + + lock(pool) + { + if(pool[type] == null || ((Stack) pool[type]).Count == 0) + { + // Creating a new packet if we cannot reuse an old package + packet = Packet.BuildPacket(type); + } + else + { + // Recycle old packages + packet=(Packet) ((Stack) pool[type]).Pop(); + } + } + + return packet; + } + + public Packet GetPacket(byte[] bytes, ref int packetEnd, byte[] zeroBuffer) { + Packet packet = GetPacket(Packet.GetType(bytes, packetEnd, zeroBuffer)); + + int i = 0; + packet.FromBytes(bytes, ref i, ref packetEnd, zeroBuffer); + return packet; + } + + public void ReturnPacket(Packet packet) { + lock(pool) + { + PacketType type=packet.Type; + + if(pool[type] == null) + { + pool[type] = new Stack(); + } + + ((Stack) pool[type]).Push(packet); + } + } + } + public class UDPServer : ClientStackNetworkHandler { protected Dictionary clientCircuits = new Dictionary(); @@ -194,7 +257,7 @@ namespace OpenSim.Region.ClientStack try { - packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); + packet = PacketPool.Instance.GetPacket(RecvBuffer, ref packetEnd, ZeroBuffer); } catch(Exception) { diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 0ec7c99..f57de1c 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -374,7 +374,7 @@ namespace OpenSim.Region.Communications.Local regData["status"] = "active"; regData["handle"] = region.ToString(); - respData[reg.RegionID.ToStringHyphenated()] = regData; + respData[reg.RegionID.ToString()] = regData; } } diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 37cea1f..2c08707 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -177,10 +177,10 @@ namespace OpenSim.Region.Communications.Local } TempHash = new Hashtable(); TempHash["name"] = InvFolder.name; - TempHash["parent_id"] = InvFolder.parentID.ToStringHyphenated(); + TempHash["parent_id"] = InvFolder.parentID.ToString(); TempHash["version"] = (Int32) InvFolder.version; TempHash["type_default"] = (Int32) InvFolder.type; - TempHash["folder_id"] = InvFolder.folderID.ToStringHyphenated(); + TempHash["folder_id"] = InvFolder.folderID.ToString(); AgentInventoryArray.Add(TempHash); } return new InventoryData(AgentInventoryArray, rootID); @@ -196,10 +196,10 @@ namespace OpenSim.Region.Communications.Local { TempHash = new Hashtable(); TempHash["name"] = InvFolder.FolderName; - TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); + TempHash["parent_id"] = InvFolder.ParentID.ToString(); TempHash["version"] = (Int32) InvFolder.Version; TempHash["type_default"] = (Int32) InvFolder.DefaultType; - TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); + TempHash["folder_id"] = InvFolder.FolderID.ToString(); AgentInventoryArray.Add(TempHash); } @@ -207,4 +207,4 @@ namespace OpenSim.Region.Communications.Local } } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index fbb83fc..060fe28 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -103,7 +103,7 @@ namespace OpenSim.Region.Communications.OGS1 // Login / Authentication GridParams["authkey"] = serversInfo.GridSendKey; - GridParams["UUID"] = regionInfo.RegionID.ToStringHyphenated(); + GridParams["UUID"] = regionInfo.RegionID.ToString(); GridParams["sim_ip"] = regionInfo.ExternalHostName; GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.ToString(); GridParams["region_locx"] = regionInfo.RegionLocX.ToString(); @@ -111,7 +111,7 @@ namespace OpenSim.Region.Communications.OGS1 GridParams["sim_name"] = regionInfo.RegionName; GridParams["http_port"] = serversInfo.HttpListenerPort.ToString(); GridParams["remoting_port"] = NetworkServersInfo.RemotingListenerPort.ToString(); - GridParams["map-image-id"] = regionInfo.EstateSettings.terrainImageID.ToStringHyphenated(); + GridParams["map-image-id"] = regionInfo.EstateSettings.terrainImageID.ToString(); // Package into an XMLRPC Request ArrayList SendParams = new ArrayList(); @@ -191,7 +191,7 @@ namespace OpenSim.Region.Communications.OGS1 { RegionInfo regionInfo; Hashtable requestData = new Hashtable(); - requestData["region_UUID"] = Region_UUID.ToStringHyphenated(); + requestData["region_UUID"] = Region_UUID.ToString(); requestData["authkey"] = serversInfo.GridSendKey; ArrayList SendParams = new ArrayList(); SendParams.Add(requestData); diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 709a227..6c1f77e 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs @@ -63,7 +63,7 @@ namespace OpenSim.Region.Communications.OGS1 { try { - Console.WriteLine("Requesting Inventory from Inventory server ( " + _inventoryServerUrl + "/GetInventory/" +" ) for " + userID.ToStringHyphenated()); + Console.WriteLine("Requesting Inventory from Inventory server ( " + _inventoryServerUrl + "/GetInventory/" +" ) for " + userID.ToString()); RestObjectPosterResponse requester = new RestObjectPosterResponse(); requester.ResponseCallback = InventoryResponse; diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index d26da90..c1e6ba6 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -118,7 +118,7 @@ namespace OpenSim.Region.Communications.OGS1 try { Hashtable param = new Hashtable(); - param["queryid"] = (string)queryID.ToStringHyphenated(); + param["queryid"] = (string)queryID.ToString(); param["avquery"] = objAlphaNumericPattern.Replace(query, ""); IList parameters = new ArrayList(); parameters.Add(param); diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 9821906..753d0cf 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -241,7 +241,7 @@ namespace OpenSim.Region.Environment.Scenes { MainLog.Instance.Verbose( "INVENTORY", - "Moving item for " + remoteClient.AgentId.ToStringHyphenated()); + "Moving item for " + remoteClient.AgentId.ToString()); CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); if (userInfo == null) diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 474d8d5..01d6c5a 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -88,7 +88,7 @@ namespace OpenSim.Region.Environment.Scenes protected SceneCommunicationService m_sceneGridService; protected SceneXmlLoader m_sceneXmlLoader; - protected Dictionary m_capsHandlers = new Dictionary(); + protected Dictionary m_capsHandlers = new Dictionary(); protected BaseHttpServer httpListener; protected Dictionary Modules = new Dictionary(); @@ -990,6 +990,7 @@ namespace OpenSim.Region.Environment.Scenes } } +/* Tree has been removed from libSL public void AddTree(LLVector3 scale, LLQuaternion rotation, LLVector3 position, libsecondlife.ObjectManager.Tree treeType, bool newTree) { @@ -1001,7 +1002,7 @@ namespace OpenSim.Region.Environment.Scenes treeShape.State = (byte)treeType; AddNewPrim(LLUUID.Random(), position, rotation, treeShape); } - +*/ public void RemovePrim(uint localID, LLUUID avatar_deleter) { m_innerScene.RemovePrim(localID, avatar_deleter); @@ -1323,8 +1324,8 @@ namespace OpenSim.Region.Environment.Scenes { if (agent.CapsPath != "") { - Caps cap = - new Caps(AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port, + OpenSim.Region.Capabilities.Caps cap = + new OpenSim.Region.Capabilities.Caps(AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port, agent.CapsPath, agent.AgentID, m_dumpAssetsToFile); Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + @@ -1335,7 +1336,7 @@ namespace OpenSim.Region.Environment.Scenes if (m_capsHandlers.ContainsKey(agent.AgentID)) { //MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " + - // agent.AgentID.ToStringHyphenated()); + // agent.AgentID.ToString()); try { m_capsHandlers[agent.AgentID] = cap; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 5e5b8b5..f3be4bd 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -1030,8 +1030,8 @@ namespace OpenSim.Region.Environment.Scenes foreach (TaskInventoryItem item in TaskInventory.Values) { invString.AddItemStart(); - invString.AddNameValueLine("item_id", item.item_id.ToStringHyphenated()); - invString.AddNameValueLine("parent_id", item.parent_id.ToStringHyphenated()); + invString.AddNameValueLine("item_id", item.item_id.ToString()); + invString.AddNameValueLine("parent_id", item.parent_id.ToString()); invString.AddPermissionsStart(); invString.AddNameValueLine("base_mask", "0x7FFFFFFF"); @@ -1039,13 +1039,13 @@ namespace OpenSim.Region.Environment.Scenes invString.AddNameValueLine("group_mask", "0x7FFFFFFF"); invString.AddNameValueLine("everyone_mask", "0x7FFFFFFF"); invString.AddNameValueLine("next_owner_mask", "0x7FFFFFFF"); - invString.AddNameValueLine("creator_id", item.creator_id.ToStringHyphenated()); - invString.AddNameValueLine("owner_id", item.owner_id.ToStringHyphenated()); - invString.AddNameValueLine("last_owner_id", item.last_owner_id.ToStringHyphenated()); - invString.AddNameValueLine("group_id", item.group_id.ToStringHyphenated()); + invString.AddNameValueLine("creator_id", item.creator_id.ToString()); + invString.AddNameValueLine("owner_id", item.owner_id.ToString()); + invString.AddNameValueLine("last_owner_id", item.last_owner_id.ToString()); + invString.AddNameValueLine("group_id", item.group_id.ToString()); invString.AddSectionEnd(); - invString.AddNameValueLine("asset_id", item.asset_id.ToStringHyphenated()); + invString.AddNameValueLine("asset_id", item.asset_id.ToString()); invString.AddNameValueLine("type", item.type); invString.AddNameValueLine("inv_type", item.inv_type); invString.AddNameValueLine("flags", "0x00"); @@ -1255,12 +1255,12 @@ namespace OpenSim.Region.Environment.Scenes tex.FaceTextures[i].RGBA = tmpcolor; } } - tmpcolor = tex.DefaultTexture.RGBA; + tmpcolor = tex.FaceTextures[0].RGBA; tmpcolor.A = tmpcolor.A * 255; tmpcolor.R = tmpcolor.R * 255; tmpcolor.G = tmpcolor.G * 255; tmpcolor.B = tmpcolor.B * 255; - tex.DefaultTexture.RGBA = tmpcolor; + tex.FaceTextures[0].RGBA = tmpcolor; UpdateTextureEntry(tex.ToBytes()); } @@ -1544,8 +1544,8 @@ namespace OpenSim.Region.Environment.Scenes public InventoryStringBuilder(LLUUID folderID, LLUUID parentID) { BuildString += "\tinv_object\t0\n\t{\n"; - AddNameValueLine("obj_id", folderID.ToStringHyphenated()); - AddNameValueLine("parent_id", parentID.ToStringHyphenated()); + AddNameValueLine("obj_id", folderID.ToString()); + AddNameValueLine("parent_id", parentID.ToString()); AddNameValueLine("type", "category"); AddNameValueLine("name", "Contents"); AddSectionEnd(); diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 62abefc..a221243 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1033,11 +1033,7 @@ namespace OpenSim.Region.Environment.Scenes { LLVector3 pos = m_pos; LLVector3 vel = Velocity; - LLQuaternion rot; - rot.X = m_bodyRot.x; - rot.Y = m_bodyRot.y; - rot.Z = m_bodyRot.z; - rot.W = m_bodyRot.w; + LLQuaternion rot=new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); remoteClient.SendAvatarTerseUpdate(m_regionHandle, 64096, LocalId, new LLVector3(pos.X, pos.Y, pos.Z), new LLVector3(vel.X, vel.Y, vel.Z), rot); } diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs index 2d684d1..09b7f48 100644 --- a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs +++ b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs @@ -56,7 +56,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples { SceneObject root = obj.Value; - sequence += "NEWOBJ::" + obj.Key.ToStringHyphenated() + "\n"; + sequence += "NEWOBJ::" + obj.Key.ToString() + "\n"; string rootPrim = processPrimitiveToString(root.rootPrimitive); @@ -91,4 +91,4 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples return ""; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index 832ccf1..1cb307f 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs @@ -471,11 +471,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler } else if (face == -1) { - texcolor = tex.DefaultTexture.RGBA; - texcolor.R = (float)Math.Abs(color.x - 1); - texcolor.G = (float)Math.Abs(color.y - 1); - texcolor.B = (float)Math.Abs(color.z - 1); - tex.DefaultTexture.RGBA = texcolor; for (uint i = 0; i < 32; i++) { if (tex.FaceTextures[i] != null) @@ -499,7 +494,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler LLObject.TextureEntry tex = new LLObject.TextureEntry(m_host.Shape.TextureEntry, 0, m_host.Shape.TextureEntry.Length); if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color { - return (double)((tex.DefaultTexture.RGBA.A * 255) / 255); + return (double)((tex.FaceTextures[0].RGBA.A * 255) / 255); } if (face > -1) { @@ -522,9 +517,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler } else if (face == -1) { - texcolor = tex.DefaultTexture.RGBA; - texcolor.A = (float)Math.Abs(alpha - 1); - tex.DefaultTexture.RGBA = texcolor; for (int i = 0; i < 32; i++) { if (tex.FaceTextures[i] != null) @@ -548,7 +540,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler LSL_Types.Vector3 rgb; if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color { - texcolor = tex.DefaultTexture.RGBA; + texcolor = tex.FaceTextures[0].RGBA; rgb.x = (255 - (texcolor.R * 255)) / 255; rgb.y = (255 - (texcolor.G * 255)) / 255; rgb.z = (255 - (texcolor.B * 255)) / 255; @@ -586,7 +578,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler tex.FaceTextures[i].TextureID = new LLUUID(texture); } } - tex.DefaultTexture.TextureID = new LLUUID(texture); m_host.UpdateTexture(tex); return; } @@ -617,8 +608,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler } } - tex.DefaultTexture.RepeatU = (float)u; - tex.DefaultTexture.RepeatV = (float)v; m_host.UpdateTexture(tex); return; } @@ -648,8 +637,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler tex.FaceTextures[i].OffsetV = (float)v; } } - tex.DefaultTexture.OffsetU = (float)u; - tex.DefaultTexture.OffsetV = (float)v; m_host.UpdateTexture(tex); return; } @@ -677,7 +664,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler tex.FaceTextures[i].Rotation = (float)rotation; } } - tex.DefaultTexture.Rotation = (float)rotation; m_host.UpdateTexture(tex); return; } @@ -696,7 +682,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler { LLObject.TextureEntryFace texface; texface = tex.GetFace((uint)face); - return texface.TextureID.ToStringHyphenated(); + return texface.TextureID.ToString(); } NotImplemented("llGetTexture"); return ""; @@ -1035,7 +1021,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public string llGetOwner() { - return m_host.ObjectOwner.ToStringHyphenated(); + return m_host.ObjectOwner.ToString(); } public void llInstantMessage(string user, string message) @@ -1063,7 +1049,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public string llGetKey() { - return m_host.UUID.ToStringHyphenated(); + return m_host.UUID.ToString(); } public void llSetBuoyancy(double buoyancy) @@ -1277,7 +1263,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); if (part != null) { - return part.UUID.ToStringHyphenated(); + return part.UUID.ToString(); } else { @@ -1621,11 +1607,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler { return "00000000-0000-0000-0000-000000000000"; } - //return OpenSim.Framework.ToStringHyphenated(src[index]); + //return OpenSim.Framework.ToString(src[index]); LLUUID tmpkey; if (LLUUID.TryParse(src.Data[index].ToString(), out tmpkey)) { - return tmpkey.ToStringHyphenated(); + return tmpkey.ToString(); } else { @@ -2380,7 +2366,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public string llGetCreator() { - return m_host.ObjectCreator.ToStringHyphenated(); + return m_host.ObjectCreator.ToString(); } public string llGetTimestamp() @@ -2807,14 +2793,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler LLUUID createdTexture = textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, extraParams, timer); - return createdTexture.ToStringHyphenated(); + return createdTexture.ToString(); } else { //TODO update existing dynamic textures } - return LLUUID.Zero.ToStringHyphenated(); + return LLUUID.Zero.ToString(); } private void NotImplemented(string Command) -- cgit v1.1