From 086bf9f15db05ca2be1cf0dda24f8ee7a368988d Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 9 Sep 2011 00:29:59 +0100
Subject: Save the default terrain texture UUIDs for a new region instead of
 leaving them as UUID.Zero.

Leaving them at UUID.Zero meant that when a viewer 2 logged into a region that had been freshly created, it received UUID.Zero for these textures, and hence display the land as plain white.
On a simulator restart, the problem would go away since when the database adapators loaded the new region settings, RegionSettings itself has code to use default textures instead of UUID.Zero.
This commit resolves the problem by saving the default texture UUIDs instead of Zero.
However, we currently have to do this in a roundabout way by resaving once the RegionSettings have been created by the database for the first time.  This needless complexity should be addressed.
This change will also have the effect of replacing any existing UUID.Zero terrain textures with the default ones.
However, this shouldn't have any effect since the UUID.Zeros were already being replaced in memory with those same UUIDs.
---
 OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'OpenSim/Capabilities')

diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index 105a1e0..e1b4fe7 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -47,7 +47,6 @@ using Caps = OpenSim.Framework.Capabilities.Caps;
 
 namespace OpenSim.Capabilities.Handlers
 {
-
     public class GetTextureHandler : BaseStreamHandler
     {
         private static readonly ILog m_log =
@@ -67,7 +66,6 @@ namespace OpenSim.Capabilities.Handlers
 
         public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
         {
-
             // Try to parse the texture ID from the request URL
             NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
             string textureStr = query.GetOne("texture_id");
@@ -85,6 +83,8 @@ namespace OpenSim.Capabilities.Handlers
             UUID textureID;
             if (!String.IsNullOrEmpty(textureStr) && UUID.TryParse(textureStr, out textureID))
             {
+//                m_log.DebugFormat("[GETTEXTURE]: Received request for texture id {0}", textureID);
+                
                 string[] formats;
                 if (format != null && format != string.Empty)
                 {
@@ -105,7 +105,6 @@ namespace OpenSim.Capabilities.Handlers
                     if (FetchTexture(httpRequest, httpResponse, textureID, f))
                         break;
                 }
-
             }
             else
             {
-- 
cgit v1.1