aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2012-02-15 01:11:17 +0000
committerMelanie2012-02-15 01:11:17 +0000
commit272ba5a741ad1b486ee11174a46fa15573a78e83 (patch)
tree41a330f517cff6bda34e38657ad0d359a35eab86 /OpenSim/Region/CoreModules
parentMerge branch 'master' into careminster (diff)
parentRefactor appearance saving for NPC to use AvatarFactoryModule interface. (diff)
downloadopensim-SC-272ba5a741ad1b486ee11174a46fa15573a78e83.zip
opensim-SC-272ba5a741ad1b486ee11174a46fa15573a78e83.tar.gz
opensim-SC-272ba5a741ad1b486ee11174a46fa15573a78e83.tar.bz2
opensim-SC-272ba5a741ad1b486ee11174a46fa15573a78e83.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs40
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs7
2 files changed, 37 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 8d503bd..c7f4c20 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -111,6 +111,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
111 111
112 #region IAvatarFactoryModule 112 #region IAvatarFactoryModule
113 113
114 /// </summary>
115 /// <param name="sp"></param>
116 /// <param name="texture"></param>
117 /// <param name="visualParam"></param>
118 public void SetAppearance(IScenePresence sp, AvatarAppearance appearance)
119 {
120 SetAppearance(sp, appearance.Texture, appearance.VisualParams);
121 }
122
114 /// <summary> 123 /// <summary>
115 /// Set appearance data (texture asset IDs and slider settings) 124 /// Set appearance data (texture asset IDs and slider settings)
116 /// </summary> 125 /// </summary>
@@ -156,14 +165,23 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
156 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; 165 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
157 166
158// WriteBakedTexturesReport(sp, m_log.DebugFormat); 167// WriteBakedTexturesReport(sp, m_log.DebugFormat);
159 if (!ValidateBakedTextureCache(sp)) 168
169 // If bake textures are missing and this is not an NPC, request a rebake from client
170 if (!ValidateBakedTextureCache(sp) && (((ScenePresence)sp).PresenceType != PresenceType.Npc))
160 RequestRebake(sp, true); 171 RequestRebake(sp, true);
161 172
162 // This appears to be set only in the final stage of the appearance 173 // This appears to be set only in the final stage of the appearance
163 // update transaction. In theory, we should be able to do an immediate 174 // update transaction. In theory, we should be able to do an immediate
164 // appearance send and save here. 175 // appearance send and save here.
165 } 176 }
166 177
178 // NPC should send to clients immediately and skip saving appearance
179 if (((ScenePresence)sp).PresenceType == PresenceType.Npc)
180 {
181 SendAppearance((ScenePresence)sp);
182 return;
183 }
184
167 // save only if there were changes, send no matter what (doesn't hurt to send twice) 185 // save only if there were changes, send no matter what (doesn't hurt to send twice)
168 if (changed) 186 if (changed)
169 QueueAppearanceSave(sp.ControllingClient.AgentId); 187 QueueAppearanceSave(sp.ControllingClient.AgentId);
@@ -174,6 +192,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
174 // m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString()); 192 // m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString());
175 } 193 }
176 194
195 private void SendAppearance(ScenePresence sp)
196 {
197 // Send the appearance to everyone in the scene
198 sp.SendAppearanceToAllOtherAgents();
199
200 // Send animations back to the avatar as well
201 sp.Animator.SendAnimPack();
202 }
203
177 public bool SendAppearance(UUID agentId) 204 public bool SendAppearance(UUID agentId)
178 { 205 {
179// m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId); 206// m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId);
@@ -185,12 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
185 return false; 212 return false;
186 } 213 }
187 214
188 // Send the appearance to everyone in the scene 215 SendAppearance(sp);
189 sp.SendAppearanceToAllOtherAgents();
190
191 // Send animations back to the avatar as well
192 sp.Animator.SendAnimPack();
193
194 return true; 216 return true;
195 } 217 }
196 218
@@ -626,4 +648,4 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
626 outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); 648 outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
627 } 649 }
628 } 650 }
629} \ No newline at end of file 651}
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 5e7d37a..ba38488 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -707,7 +707,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
707 // Object owners should be able to edit their own content 707 // Object owners should be able to edit their own content
708 if (currentUser == objectOwner) 708 if (currentUser == objectOwner)
709 { 709 {
710 permission = true; 710 // there is no way that later code can change this back to false
711 // so just return true immediately and short circuit the more
712 // expensive group checks
713 return true;
714
715 //permission = true;
711 } 716 }
712 else if (group.IsAttachment) 717 else if (group.IsAttachment)
713 { 718 {