aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs98
1 files changed, 1 insertions, 97 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 8ee7d89..35a8df7 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -131,6 +131,7 @@ namespace OpenSim.Region.Framework.Scenes
131// private SceneObjectGroup proxyObjectGroup; 131// private SceneObjectGroup proxyObjectGroup;
132 //private SceneObjectPart proxyObjectPart = null; 132 //private SceneObjectPart proxyObjectPart = null;
133 public Vector3 lastKnownAllowedPosition; 133 public Vector3 lastKnownAllowedPosition;
134 public bool sentMessageAboutRestrictedParcelFlyingDown;
134 public Vector4 CollisionPlane = Vector4.UnitW; 135 public Vector4 CollisionPlane = Vector4.UnitW;
135 136
136 private Vector3 m_avInitialPos; // used to calculate unscripted sit rotation 137 private Vector3 m_avInitialPos; // used to calculate unscripted sit rotation
@@ -4316,103 +4317,6 @@ if (m_animator.m_jumping) force.Z = m_animator.m_jumpVelocity; // add for ju
4316 return flags; 4317 return flags;
4317 } 4318 }
4318 4319
4319 /// <summary>
4320 /// RezAttachments. This should only be called upon login on the first region.
4321 /// Attachment rezzings on crossings and TPs are done in a different way.
4322 /// </summary>
4323 public void RezAttachments()
4324 {
4325 if (null == m_appearance)
4326 {
4327 m_log.WarnFormat("[ATTACHMENT]: Appearance has not been initialized for agent {0}", UUID);
4328 return;
4329 }
4330
4331 XmlDocument doc = new XmlDocument();
4332 string stateData = String.Empty;
4333
4334 IAttachmentsService attServ = m_scene.RequestModuleInterface<IAttachmentsService>();
4335 if (attServ != null)
4336 {
4337 m_log.DebugFormat("[ATTACHMENT]: Loading attachment data from attachment service");
4338 stateData = attServ.Get(ControllingClient.AgentId.ToString());
4339 if (stateData != String.Empty)
4340 {
4341 try
4342 {
4343 doc.LoadXml(stateData);
4344 }
4345 catch { }
4346 }
4347 }
4348
4349 Dictionary<UUID, string> itemData = new Dictionary<UUID, string>();
4350
4351 XmlNodeList nodes = doc.GetElementsByTagName("Attachment");
4352 if (nodes.Count > 0)
4353 {
4354 foreach (XmlNode n in nodes)
4355 {
4356 XmlElement elem = (XmlElement)n;
4357 string itemID = elem.GetAttribute("ItemID");
4358 string xml = elem.InnerXml;
4359
4360 itemData[new UUID(itemID)] = xml;
4361 }
4362 }
4363
4364 List<AvatarAttachment> attachments = m_appearance.GetAttachments();
4365 foreach (AvatarAttachment attach in attachments)
4366 {
4367 if (IsDeleted)
4368 return;
4369
4370 int p = attach.AttachPoint;
4371 UUID itemID = attach.ItemID;
4372
4373 //UUID assetID = attach.AssetID;
4374 // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down
4375 // But they're not used anyway, the item is being looked up for now, so let's proceed.
4376 //if (UUID.Zero == assetID)
4377 //{
4378 // m_log.DebugFormat("[ATTACHMENT]: Cannot rez attachment in point {0} with itemID {1}", p, itemID);
4379 // continue;
4380 //}
4381
4382 try
4383 {
4384 string xmlData;
4385 XmlDocument d = new XmlDocument();
4386 UUID asset;
4387 if (itemData.TryGetValue(itemID, out xmlData))
4388 {
4389 d.LoadXml(xmlData);
4390 m_log.InfoFormat("[ATTACHMENT]: Found saved state for item {0}, loading it", itemID);
4391
4392 // Rez from inventory
4393 asset
4394 = m_scene.AttachmentsModule.RezSingleAttachmentFromInventory(ControllingClient, itemID, (uint)p, true, d);
4395
4396 }
4397 else
4398 {
4399 // Rez from inventory (with a null doc to let
4400 // CHANGED_OWNER happen)
4401 asset
4402 = m_scene.AttachmentsModule.RezSingleAttachmentFromInventory(ControllingClient, itemID, (uint)p, true, null);
4403 }
4404
4405 m_log.InfoFormat(
4406 "[ATTACHMENT]: Rezzed attachment in point {0} from item {1} and asset {2}",
4407 p, itemID, asset);
4408 }
4409 catch (Exception e)
4410 {
4411 m_log.ErrorFormat("[ATTACHMENT]: Unable to rez attachment: {0}{1}", e.Message, e.StackTrace);
4412 }
4413 }
4414 }
4415
4416 private void ReprioritizeUpdates() 4320 private void ReprioritizeUpdates()
4417 { 4321 {
4418 if (Scene.IsReprioritizationEnabled && Scene.UpdatePrioritizationScheme != UpdatePrioritizationSchemes.Time) 4322 if (Scene.IsReprioritizationEnabled && Scene.UpdatePrioritizationScheme != UpdatePrioritizationSchemes.Time)