mirror of
https://github.com/opensim/opensim.git
synced 2026-05-27 12:26:01 +08:00
remove the option to store baked textures on assets service, thats suicide use xbakes
This commit is contained in:
@@ -63,9 +63,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
private static readonly string m_uploadBakedTexturePath = "0010/";// This is in the LandManagementModule.
|
||||
|
||||
private Scene m_scene;
|
||||
private bool m_persistBakedTextures;
|
||||
|
||||
private IBakedTextureModule m_BakedTextureModule;
|
||||
private string m_URL;
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
@@ -76,15 +74,12 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
m_URL = config.GetString("Cap_UploadBakedTexture", string.Empty);
|
||||
|
||||
IConfig appearanceConfig = source.Configs["Appearance"];
|
||||
if (appearanceConfig != null)
|
||||
m_persistBakedTextures = appearanceConfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
|
||||
// IConfig appearanceConfig = source.Configs["Appearance"];
|
||||
}
|
||||
|
||||
public void AddRegion(Scene s)
|
||||
{
|
||||
m_scene = s;
|
||||
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene s)
|
||||
@@ -92,7 +87,6 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
s.EventManager.OnRegisterCaps -= RegisterCaps;
|
||||
s.EventManager.OnNewPresence -= RegisterNewPresence;
|
||||
s.EventManager.OnRemovePresence -= DeRegisterPresence;
|
||||
m_BakedTextureModule = null;
|
||||
m_scene = null;
|
||||
}
|
||||
|
||||
@@ -101,7 +95,6 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
|
||||
m_scene.EventManager.OnNewPresence += RegisterNewPresence;
|
||||
m_scene.EventManager.OnRemovePresence += DeRegisterPresence;
|
||||
|
||||
}
|
||||
|
||||
private void DeRegisterPresence(UUID agentId)
|
||||
@@ -110,156 +103,12 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
private void RegisterNewPresence(ScenePresence presence)
|
||||
{
|
||||
// presence.ControllingClient.OnSetAppearance += CaptureAppearanceSettings;
|
||||
}
|
||||
|
||||
/* not in use. work done in AvatarFactoryModule ValidateBakedTextureCache() and UpdateBakedTextureCache()
|
||||
private void CaptureAppearanceSettings(IClientAPI remoteClient, Primitive.TextureEntry textureEntry, byte[] visualParams, Vector3 avSize, WearableCacheItem[] cacheItems)
|
||||
{
|
||||
// if cacheItems.Length > 0 viewer is giving us current textures information.
|
||||
// baked ones should had been uploaded and in assets cache as local itens
|
||||
|
||||
|
||||
if (cacheItems.Length == 0)
|
||||
return; // no textures information, nothing to do
|
||||
|
||||
ScenePresence p = null;
|
||||
if (!m_scene.TryGetScenePresence(remoteClient.AgentId, out p))
|
||||
return; // what are we doing if there is no presence to cache for?
|
||||
|
||||
if (p.IsDeleted)
|
||||
return; // does this really work?
|
||||
|
||||
int maxCacheitemsLoop = cacheItems.Length;
|
||||
if (maxCacheitemsLoop > 20)
|
||||
{
|
||||
maxCacheitemsLoop = AvatarWearable.MAX_WEARABLES;
|
||||
m_log.WarnFormat("[CACHEDBAKES]: Too Many Cache items Provided {0}, the max is {1}. Truncating!", cacheItems.Length, AvatarWearable.MAX_WEARABLES);
|
||||
}
|
||||
|
||||
m_BakedTextureModule = m_scene.RequestModuleInterface<IBakedTextureModule>();
|
||||
|
||||
|
||||
// some nice debug
|
||||
m_log.Debug("[Cacheitems]: " + cacheItems.Length);
|
||||
for (int iter = 0; iter < maxCacheitemsLoop; iter++)
|
||||
{
|
||||
m_log.Debug("[Cacheitems] {" + iter + "/" + cacheItems[iter].TextureIndex + "}: c-" + cacheItems[iter].CacheId + ", t-" +
|
||||
cacheItems[iter].TextureID);
|
||||
}
|
||||
|
||||
// p.Appearance.WearableCacheItems is in memory primary cashID to textures mapper
|
||||
|
||||
WearableCacheItem[] existingitems = p.Appearance.WearableCacheItems;
|
||||
|
||||
if (existingitems == null)
|
||||
{
|
||||
if (m_BakedTextureModule != null)
|
||||
{
|
||||
WearableCacheItem[] savedcache = null;
|
||||
try
|
||||
{
|
||||
if (p.Appearance.WearableCacheItemsDirty)
|
||||
{
|
||||
savedcache = m_BakedTextureModule.Get(p.UUID);
|
||||
p.Appearance.WearableCacheItems = savedcache;
|
||||
p.Appearance.WearableCacheItemsDirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
catch (Exception)
|
||||
{
|
||||
// The service logs a sufficient error message.
|
||||
}
|
||||
|
||||
|
||||
if (savedcache != null)
|
||||
existingitems = savedcache;
|
||||
}
|
||||
}
|
||||
|
||||
// Existing items null means it's a fully new appearance
|
||||
if (existingitems == null)
|
||||
{
|
||||
for (int i = 0; i < maxCacheitemsLoop; i++)
|
||||
{
|
||||
if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex)
|
||||
{
|
||||
Primitive.TextureEntryFace face = textureEntry.FaceTextures[cacheItems[i].TextureIndex];
|
||||
if (face == null)
|
||||
{
|
||||
textureEntry.CreateFace(cacheItems[i].TextureIndex);
|
||||
textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID =
|
||||
AppearanceManager.DEFAULT_AVATAR_TEXTURE;
|
||||
continue;
|
||||
}
|
||||
cacheItems[i].TextureID = face.TextureID;
|
||||
if (m_scene.AssetService != null)
|
||||
cacheItems[i].TextureAsset =
|
||||
m_scene.AssetService.GetCached(cacheItems[i].TextureID.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat("[CACHEDBAKES]: Invalid Texture Index Provided, Texture doesn't exist or hasn't been uploaded yet {0}, the max is {1}. Skipping!", cacheItems[i].TextureIndex, textureEntry.FaceTextures.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < maxCacheitemsLoop; i++)
|
||||
{
|
||||
if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex)
|
||||
{
|
||||
Primitive.TextureEntryFace face = textureEntry.FaceTextures[cacheItems[i].TextureIndex];
|
||||
if (face == null)
|
||||
{
|
||||
textureEntry.CreateFace(cacheItems[i].TextureIndex);
|
||||
textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID =
|
||||
AppearanceManager.DEFAULT_AVATAR_TEXTURE;
|
||||
continue;
|
||||
}
|
||||
cacheItems[i].TextureID =
|
||||
face.TextureID;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat("[CACHEDBAKES]: Invalid Texture Index Provided, Texture doesn't exist or hasn't been uploaded yet {0}, the max is {1}. Skipping!", cacheItems[i].TextureIndex, textureEntry.FaceTextures.Length);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < maxCacheitemsLoop; i++)
|
||||
{
|
||||
if (cacheItems[i].TextureAsset == null)
|
||||
{
|
||||
cacheItems[i].TextureAsset =
|
||||
m_scene.AssetService.GetCached(cacheItems[i].TextureID.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
p.Appearance.WearableCacheItems = cacheItems;
|
||||
|
||||
if (m_BakedTextureModule != null)
|
||||
{
|
||||
m_BakedTextureModule.Store(remoteClient.AgentId, cacheItems);
|
||||
p.Appearance.WearableCacheItemsDirty = true;
|
||||
|
||||
}
|
||||
else
|
||||
p.Appearance.WearableCacheItemsDirty = false;
|
||||
|
||||
for (int iter = 0; iter < maxCacheitemsLoop; iter++)
|
||||
{
|
||||
m_log.Debug("[CacheitemsLeaving] {" + iter + "/" + cacheItems[iter].TextureIndex + "}: c-" + cacheItems[iter].CacheId + ", t-" +
|
||||
cacheItems[iter].TextureID);
|
||||
}
|
||||
}
|
||||
*/
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Close() { }
|
||||
|
||||
public string Name { get { return "UploadBakedTextureModule"; } }
|
||||
@@ -275,7 +124,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
if (m_URL == "localhost")
|
||||
{
|
||||
UploadBakedTextureHandler avatarhandler = new UploadBakedTextureHandler(
|
||||
caps, m_scene.AssetService, m_persistBakedTextures);
|
||||
caps, m_scene.AssetService);
|
||||
|
||||
caps.RegisterHandler(
|
||||
"UploadBakedTexture",
|
||||
|
||||
Reference in New Issue
Block a user