exclude npcs from baked cache

avinationmerge
UbitUmarov 2014-09-19 16:51:51 +01:00
parent 242bb425f3
commit 9c552212a9
2 changed files with 24 additions and 7 deletions

View File

@ -366,6 +366,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// called on textures update // called on textures update
public bool UpdateBakedTextureCache(IScenePresence sp, WearableCacheItem[] cacheItems) public bool UpdateBakedTextureCache(IScenePresence sp, WearableCacheItem[] cacheItems)
{ {
// npcs dont have baked cache
if (((ScenePresence)sp).isNPC)
return true;
// uploaded baked textures will be in assets local cache // uploaded baked textures will be in assets local cache
IAssetService cache = m_scene.AssetService; IAssetService cache = m_scene.AssetService;
@ -485,6 +489,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
{ {
int hits = 0; int hits = 0;
if (((ScenePresence)sp).isNPC)
return true;
lock (m_setAppearanceLock) lock (m_setAppearanceLock)
{ {
IAssetService cache = m_scene.AssetService; IAssetService cache = m_scene.AssetService;
@ -650,6 +657,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
public int RequestRebake(IScenePresence sp, bool missingTexturesOnly) public int RequestRebake(IScenePresence sp, bool missingTexturesOnly)
{ {
if (((ScenePresence)sp).isNPC)
return 0;
int texturesRebaked = 0; int texturesRebaked = 0;
IImprovedAssetCache cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); IImprovedAssetCache cache = m_scene.RequestModuleInterface<IImprovedAssetCache>();

View File

@ -1703,6 +1703,7 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat("[CompleteMovement] WaitForUpdateAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); m_log.DebugFormat("[CompleteMovement] WaitForUpdateAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
if (!MakeRootAgent(AbsolutePosition, flying)) if (!MakeRootAgent(AbsolutePosition, flying))
{ {
m_log.DebugFormat( m_log.DebugFormat(
@ -1724,7 +1725,7 @@ namespace OpenSim.Region.Framework.Scenes
look = new Vector3(0.99f, 0.042f, 0); look = new Vector3(0.99f, 0.042f, 0);
} }
if (!IsChildAgent) if (!IsChildAgent && !isNPC)
{ {
InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (AssetType)46); InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (AssetType)46);
if (cof == null) if (cof == null)
@ -1790,16 +1791,22 @@ namespace OpenSim.Region.Framework.Scenes
// verify baked textures and cache // verify baked textures and cache
bool cachedbaked = false; bool cachedbaked = false;
if (m_scene.AvatarFactory != null) if (isNPC)
cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); cachedbaked = true;
else
// not sure we need this
if (!cachedbaked)
{ {
if (m_scene.AvatarFactory != null) if (m_scene.AvatarFactory != null)
m_scene.AvatarFactory.QueueAppearanceSave(UUID); cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this);
// not sure we need this
if (!cachedbaked)
{
if (m_scene.AvatarFactory != null)
m_scene.AvatarFactory.QueueAppearanceSave(UUID);
}
} }
List<ScenePresence> allpresences = m_scene.GetScenePresences(); List<ScenePresence> allpresences = m_scene.GetScenePresences();