diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
4 files changed, 71 insertions, 43 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index faa413e..7200c4b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -143,7 +143,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
143 | } | 143 | } |
144 | catch (Exception e) | 144 | catch (Exception e) |
145 | { | 145 | { |
146 | m_log.ErrorFormat("[ATTACHMENTS MODULE]: Unable to rez attachment: {0}{1}", e.Message, e.StackTrace); | 146 | UUID agentId = (sp.ControllingClient == null) ? (UUID)null : sp.ControllingClient.AgentId; |
147 | m_log.ErrorFormat("[ATTACHMENTS MODULE]: Unable to rez attachment with itemID {0}, assetID {1}, point {2} for {3}: {4}\n{5}", | ||
148 | attach.ItemID, attach.AssetID, p, agentId, e.Message, e.StackTrace); | ||
147 | } | 149 | } |
148 | } | 150 | } |
149 | } | 151 | } |
@@ -389,7 +391,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
389 | lock (sp.AttachmentsSyncLock) | 391 | lock (sp.AttachmentsSyncLock) |
390 | { | 392 | { |
391 | // Save avatar attachment information | 393 | // Save avatar attachment information |
392 | m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + sp.UUID + ", ItemID: " + itemID); | 394 | // m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + sp.UUID + ", ItemID: " + itemID); |
393 | 395 | ||
394 | bool changed = sp.Appearance.DetachAttachment(itemID); | 396 | bool changed = sp.Appearance.DetachAttachment(itemID); |
395 | if (changed && m_scene.AvatarFactory != null) | 397 | if (changed && m_scene.AvatarFactory != null) |
@@ -469,9 +471,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
469 | 471 | ||
470 | if (grp.HasGroupChanged || (saveAllScripted && grp.ContainsScripts())) | 472 | if (grp.HasGroupChanged || (saveAllScripted && grp.ContainsScripts())) |
471 | { | 473 | { |
472 | m_log.DebugFormat( | 474 | // m_log.DebugFormat( |
473 | "[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}", | 475 | // "[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}", |
474 | grp.UUID, grp.AttachmentPoint); | 476 | // grp.UUID, grp.AttachmentPoint); |
475 | 477 | ||
476 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp); | 478 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp); |
477 | 479 | ||
@@ -502,12 +504,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
502 | } | 504 | } |
503 | grp.HasGroupChanged = false; // Prevent it being saved over and over | 505 | grp.HasGroupChanged = false; // Prevent it being saved over and over |
504 | } | 506 | } |
505 | else | 507 | // else |
506 | { | 508 | // { |
507 | m_log.DebugFormat( | 509 | // m_log.DebugFormat( |
508 | "[ATTACHMENTS MODULE]: Don't need to update asset for unchanged attachment {0}, attachpoint {1}", | 510 | // "[ATTACHMENTS MODULE]: Don't need to update asset for unchanged attachment {0}, attachpoint {1}", |
509 | grp.UUID, grp.AttachmentPoint); | 511 | // grp.UUID, grp.AttachmentPoint); |
510 | } | 512 | // } |
511 | } | 513 | } |
512 | 514 | ||
513 | /// <summary> | 515 | /// <summary> |
@@ -889,13 +891,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
889 | // Calls attach with a Zero position | 891 | // Calls attach with a Zero position |
890 | if (AttachObject(sp, part.ParentGroup, AttachmentPt, false)) | 892 | if (AttachObject(sp, part.ParentGroup, AttachmentPt, false)) |
891 | { | 893 | { |
892 | m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.FromItemID, remoteClient.AgentId); | 894 | // m_log.Debug( |
895 | // "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId | ||
896 | // + ", AttachmentPoint: " + AttachmentPt); | ||
893 | 897 | ||
894 | // Save avatar attachment information | 898 | // Save avatar attachment information |
895 | m_log.Debug( | 899 | m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.FromItemID, remoteClient.AgentId); |
896 | "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId | ||
897 | + ", AttachmentPoint: " + AttachmentPt); | ||
898 | |||
899 | } | 900 | } |
900 | } | 901 | } |
901 | catch (Exception e) | 902 | catch (Exception e) |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index b0cee03..0ed10d2 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
158 | // Process the baked texture array | 158 | // Process the baked texture array |
159 | if (textureEntry != null) | 159 | if (textureEntry != null) |
160 | { | 160 | { |
161 | m_log.InfoFormat("[AVFACTORY]: Received texture update for {0} {1}", sp.Name, sp.UUID); | 161 | // m_log.DebugFormat("[AVFACTORY]: Received texture update for {0} {1}", sp.Name, sp.UUID); |
162 | 162 | ||
163 | // WriteBakedTexturesReport(sp, m_log.DebugFormat); | 163 | // WriteBakedTexturesReport(sp, m_log.DebugFormat); |
164 | 164 | ||
@@ -208,7 +208,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
208 | ScenePresence sp = m_scene.GetScenePresence(agentId); | 208 | ScenePresence sp = m_scene.GetScenePresence(agentId); |
209 | if (sp == null) | 209 | if (sp == null) |
210 | { | 210 | { |
211 | m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentId); | 211 | // This is expected if the user has gone away. |
212 | // m_log.DebugFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentId); | ||
212 | return false; | 213 | return false; |
213 | } | 214 | } |
214 | 215 | ||
@@ -248,10 +249,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
248 | 249 | ||
249 | if (bakedTextureFace == null) | 250 | if (bakedTextureFace == null) |
250 | { | 251 | { |
251 | m_log.WarnFormat( | 252 | // This can happen legitimately, since some baked textures might not exist |
252 | "[AV FACTORY]: No texture ID set for {0} for {1} in {2} not found when trying to save permanently", | 253 | //m_log.WarnFormat( |
253 | bakeType, sp.Name, m_scene.RegionInfo.RegionName); | 254 | // "[AV FACTORY]: No texture ID set for {0} for {1} in {2} not found when trying to save permanently", |
254 | 255 | // bakeType, sp.Name, m_scene.RegionInfo.RegionName); | |
255 | continue; | 256 | continue; |
256 | } | 257 | } |
257 | 258 | ||
@@ -337,7 +338,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
337 | return false; | 338 | return false; |
338 | } | 339 | } |
339 | 340 | ||
340 | m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0} {1}", sp.Name, sp.UUID); | 341 | // m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0} {1}", sp.Name, sp.UUID); |
341 | 342 | ||
342 | // If we only found default textures, then the appearance is not cached | 343 | // If we only found default textures, then the appearance is not cached |
343 | return (defonly ? false : true); | 344 | return (defonly ? false : true); |
@@ -417,7 +418,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
417 | // acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); | 418 | // acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); |
418 | 419 | ||
419 | int ftIndex = (int)AppearanceManager.BakeTypeToAgentTextureIndex(bakeType); | 420 | int ftIndex = (int)AppearanceManager.BakeTypeToAgentTextureIndex(bakeType); |
420 | bakedTextures[bakeType] = faceTextures[ftIndex]; | 421 | Primitive.TextureEntryFace texture = faceTextures[ftIndex]; // this will be null if there's no such baked texture |
422 | bakedTextures[bakeType] = texture; | ||
421 | } | 423 | } |
422 | 424 | ||
423 | return bakedTextures; | 425 | return bakedTextures; |
@@ -482,7 +484,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
482 | ScenePresence sp = m_scene.GetScenePresence(agentid); | 484 | ScenePresence sp = m_scene.GetScenePresence(agentid); |
483 | if (sp == null) | 485 | if (sp == null) |
484 | { | 486 | { |
485 | m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid); | 487 | // This is expected if the user has gone away. |
488 | // m_log.DebugFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid); | ||
486 | return; | 489 | return; |
487 | } | 490 | } |
488 | 491 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 10b4c37..e4452fb 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -186,6 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
186 | { | 186 | { |
187 | string fromName = c.From; | 187 | string fromName = c.From; |
188 | UUID fromID = UUID.Zero; | 188 | UUID fromID = UUID.Zero; |
189 | UUID targetID = c.TargetUUID; | ||
189 | string message = c.Message; | 190 | string message = c.Message; |
190 | IScene scene = c.Scene; | 191 | IScene scene = c.Scene; |
191 | Vector3 fromPos = c.Position; | 192 | Vector3 fromPos = c.Position; |
@@ -221,24 +222,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
221 | message = message.Substring(0, 1000); | 222 | message = message.Substring(0, 1000); |
222 | 223 | ||
223 | // m_log.DebugFormat( | 224 | // m_log.DebugFormat( |
224 | // "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}", | 225 | // "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}, targetID {5}", |
225 | // fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType); | 226 | // fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType, targetID); |
226 | 227 | ||
227 | HashSet<UUID> receiverIDs = new HashSet<UUID>(); | 228 | HashSet<UUID> receiverIDs = new HashSet<UUID>(); |
228 | 229 | ||
229 | foreach (Scene s in m_scenes) | 230 | foreach (Scene s in m_scenes) |
230 | { | 231 | { |
231 | // This should use ForEachClient, but clients don't have a position. | 232 | if (targetID == UUID.Zero) |
232 | // If camera is moved into client, then camera position can be used | 233 | { |
233 | s.ForEachRootScenePresence( | 234 | // This should use ForEachClient, but clients don't have a position. |
234 | delegate(ScenePresence presence) | 235 | // If camera is moved into client, then camera position can be used |
236 | s.ForEachRootScenePresence( | ||
237 | delegate(ScenePresence presence) | ||
238 | { | ||
239 | if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType, false)) | ||
240 | receiverIDs.Add(presence.UUID); | ||
241 | } | ||
242 | ); | ||
243 | } | ||
244 | else | ||
245 | { | ||
246 | // This is a send to a specific client eg from llRegionSayTo | ||
247 | // no need to check distance etc, jand send is as say | ||
248 | ScenePresence presence = s.GetScenePresence(targetID); | ||
249 | if (presence != null && !presence.IsChildAgent) | ||
235 | { | 250 | { |
236 | if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType)) | 251 | if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, ChatTypeEnum.Say, message, sourceType, true)) |
237 | receiverIDs.Add(presence.UUID); | 252 | receiverIDs.Add(presence.UUID); |
238 | } | 253 | } |
239 | ); | 254 | } |
240 | } | 255 | } |
241 | 256 | ||
242 | (scene as Scene).EventManager.TriggerOnChatToClients( | 257 | (scene as Scene).EventManager.TriggerOnChatToClients( |
243 | fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully); | 258 | fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully); |
244 | } | 259 | } |
@@ -315,7 +330,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
315 | /// precondition</returns> | 330 | /// precondition</returns> |
316 | protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos, | 331 | protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos, |
317 | UUID fromAgentID, string fromName, ChatTypeEnum type, | 332 | UUID fromAgentID, string fromName, ChatTypeEnum type, |
318 | string message, ChatSourceType src) | 333 | string message, ChatSourceType src, bool ignoreDistance) |
319 | { | 334 | { |
320 | // don't send stuff to child agents | 335 | // don't send stuff to child agents |
321 | if (presence.IsChildAgent) return false; | 336 | if (presence.IsChildAgent) return false; |
@@ -326,12 +341,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
326 | presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); | 341 | presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); |
327 | 342 | ||
328 | int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos); | 343 | int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos); |
329 | 344 | ||
330 | if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance || | 345 | if (!ignoreDistance) |
331 | type == ChatTypeEnum.Say && dis > m_saydistance || | ||
332 | type == ChatTypeEnum.Shout && dis > m_shoutdistance) | ||
333 | { | 346 | { |
334 | return false; | 347 | if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance || |
348 | type == ChatTypeEnum.Say && dis > m_saydistance || | ||
349 | type == ChatTypeEnum.Shout && dis > m_shoutdistance) | ||
350 | { | ||
351 | return false; | ||
352 | } | ||
335 | } | 353 | } |
336 | 354 | ||
337 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView | 355 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView |
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs index d295384..2d4cffd 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs | |||
@@ -151,11 +151,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure | |||
151 | Scene scene = (Scene)(client.Scene); | 151 | Scene scene = (Scene)(client.Scene); |
152 | ScenePresence presence = scene.GetScenePresence(client.AgentId); | 152 | ScenePresence presence = scene.GetScenePresence(client.AgentId); |
153 | 153 | ||
154 | // Round up Z co-ordinate rather than round-down by casting. This stops tall avatars from being given | ||
155 | // a teleport Z co-ordinate by short avatars that drops them through or embeds them in thin floors on | ||
156 | // arrival. | ||
157 | // | ||
158 | // Ideally we would give the exact float position adjusting for the relative height of the two avatars | ||
159 | // but it looks like a float component isn't possible with a parcel ID. | ||
154 | UUID dest = Util.BuildFakeParcelID( | 160 | UUID dest = Util.BuildFakeParcelID( |
155 | scene.RegionInfo.RegionHandle, | 161 | scene.RegionInfo.RegionHandle, |
156 | (uint)presence.AbsolutePosition.X, | 162 | (uint)presence.AbsolutePosition.X, |
157 | (uint)presence.AbsolutePosition.Y, | 163 | (uint)presence.AbsolutePosition.Y, |
158 | (uint)presence.AbsolutePosition.Z); | 164 | (uint)Math.Ceiling(presence.AbsolutePosition.Z)); |
159 | 165 | ||
160 | m_log.DebugFormat("TP invite with message {0}", message); | 166 | m_log.DebugFormat("TP invite with message {0}", message); |
161 | 167 | ||