aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs66
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs12
4 files changed, 80 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 29e3580..e8aee3e 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -26,16 +26,15 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using System.Reflection; 30using System.Reflection;
31using System.Threading;
32using System.Text;
33using System.Timers;
30using log4net; 34using log4net;
31using Nini.Config; 35using Nini.Config;
32using OpenMetaverse; 36using OpenMetaverse;
33using OpenSim.Framework; 37using OpenSim.Framework;
34
35using System.Threading;
36using System.Timers;
37using System.Collections.Generic;
38
39using OpenSim.Region.Framework.Interfaces; 38using OpenSim.Region.Framework.Interfaces;
40using OpenSim.Region.Framework.Scenes; 39using OpenSim.Region.Framework.Scenes;
41using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
@@ -45,6 +44,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
45 public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule 44 public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule
46 { 45 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47
48 public const string BAKED_TEXTURES_REPORT_FORMAT = "{0,-9} {1}";
49
48 private Scene m_scene = null; 50 private Scene m_scene = null;
49 51
50 private int m_savetime = 5; // seconds to wait before saving changed appearance 52 private int m_savetime = 5; // seconds to wait before saving changed appearance
@@ -147,9 +149,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
147 // Process the baked texture array 149 // Process the baked texture array
148 if (textureEntry != null) 150 if (textureEntry != null)
149 { 151 {
152 m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID);
153
154// WriteBakedTexturesReport(sp, m_log.DebugFormat);
155
150 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; 156 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
151 157
152 m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID); 158// WriteBakedTexturesReport(sp, m_log.DebugFormat);
153 ValidateBakedTextureCache(sp, false); 159 ValidateBakedTextureCache(sp, false);
154 160
155 // This appears to be set only in the final stage of the appearance 161 // This appears to be set only in the final stage of the appearance
@@ -254,9 +260,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
254 } 260 }
255 261
256 /// <summary> 262 /// <summary>
257 /// Queue up a request to send appearance, makes it possible to 263 /// Queue up a request to send appearance.
258 /// accumulate changes without sending out each one separately.
259 /// </summary> 264 /// </summary>
265 /// <remarks>
266 /// Makes it possible to accumulate changes without sending out each one separately.
267 /// </remarks>
268 /// <param name="agentId"></param>
260 public void QueueAppearanceSend(UUID agentid) 269 public void QueueAppearanceSend(UUID agentid)
261 { 270 {
262// m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid); 271// m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid);
@@ -408,10 +417,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
408 m_savequeue.Remove(avatarID); 417 m_savequeue.Remove(avatarID);
409 } 418 }
410 } 419 }
411 }
412 420
413 if (m_savequeue.Count == 0 && m_sendqueue.Count == 0) 421 // We must lock both queues here so that QueueAppearanceSave() or *Send() don't m_updateTimer.Start() on
414 m_updateTimer.Stop(); 422 // another thread inbetween the first count calls and m_updateTimer.Stop() on this thread.
423 lock (m_sendqueue)
424 if (m_savequeue.Count == 0 && m_sendqueue.Count == 0)
425 m_updateTimer.Stop();
426 }
415 } 427 }
416 428
417 private void SaveAppearance(UUID agentid) 429 private void SaveAppearance(UUID agentid)
@@ -557,5 +569,37 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
557 } 569 }
558 } 570 }
559 #endregion 571 #endregion
572
573 public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction)
574 {
575 outputAction("For {0} in {1}", sp.Name, m_scene.RegionInfo.RegionName);
576 outputAction(BAKED_TEXTURES_REPORT_FORMAT, "Bake Type", "UUID");
577
578 Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures = GetBakedTextureFaces(sp.UUID);
579
580 foreach (BakeType bt in bakedTextures.Keys)
581 {
582 string rawTextureID;
583
584 if (bakedTextures[bt] == null)
585 {
586 rawTextureID = "not set";
587 }
588 else
589 {
590 rawTextureID = bakedTextures[bt].TextureID.ToString();
591
592 if (m_scene.AssetService.Get(rawTextureID) == null)
593 rawTextureID += " (not found)";
594 else
595 rawTextureID += " (uploaded)";
596 }
597
598 outputAction(BAKED_TEXTURES_REPORT_FORMAT, bt, rawTextureID);
599 }
600
601 bool bakedTextureValid = m_scene.AvatarFactory.ValidateBakedTextureCache(sp);
602 outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
603 }
560 } 604 }
561} 605}
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 2f947fd..87f292c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1213,7 +1213,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1213 AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); 1213 AgentCircuitData agent = sp.ControllingClient.RequestClientInfo();
1214 agent.BaseFolder = UUID.Zero; 1214 agent.BaseFolder = UUID.Zero;
1215 agent.InventoryFolder = UUID.Zero; 1215 agent.InventoryFolder = UUID.Zero;
1216 agent.startpos = new Vector3(128, 128, 70); 1216 agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour);
1217 agent.child = true; 1217 agent.child = true;
1218 agent.Appearance = sp.Appearance; 1218 agent.Appearance = sp.Appearance;
1219 if (currentAgentCircuit != null) 1219 if (currentAgentCircuit != null)
@@ -1305,6 +1305,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1305 } 1305 }
1306 } 1306 }
1307 1307
1308 Vector3 CalculateOffset(ScenePresence sp, GridRegion neighbour)
1309 {
1310 int rRegionX = (int)sp.Scene.RegionInfo.RegionLocX;
1311 int rRegionY = (int)sp.Scene.RegionInfo.RegionLocY;
1312 int tRegionX = neighbour.RegionLocX / (int)Constants.RegionSize;
1313 int tRegionY = neighbour.RegionLocY / (int)Constants.RegionSize;
1314 int shiftx = (rRegionX - tRegionX) * (int)Constants.RegionSize;
1315 int shifty = (rRegionY - tRegionY) * (int)Constants.RegionSize;
1316 return new Vector3(shiftx, shifty, 0f);
1317 }
1318
1308 private void InformClientOfNeighbourCompleted(IAsyncResult iar) 1319 private void InformClientOfNeighbourCompleted(IAsyncResult iar)
1309 { 1320 {
1310 InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState; 1321 InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index a87279a..cc9ba97 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -123,7 +123,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
123 { 123 {
124 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID); 124 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID);
125 GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID); 125 GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID);
126 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination serveruri -> {0}", real_destination.ServerURI); 126 if (real_destination != null)
127 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination serveruri -> {0}", real_destination.ServerURI);
128 else
129 m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion to Gatekeeper {0} failed", region.ServerURI);
127 return real_destination; 130 return real_destination;
128 } 131 }
129 return region; 132 return region;
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 7760382..cdecd2f 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -384,9 +384,15 @@ namespace OpenSim.Region.CoreModules.World.Permissions
384 if (m_debugPermissions) 384 if (m_debugPermissions)
385 m_log.Debug("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName); 385 m_log.Debug("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName);
386 } 386 }
387 387
388 // Checks if the given group is active and if the user is a group member 388 /// <summary>
389 // with the powers requested (powers = 0 for no powers check) 389 /// Checks if the given group is active and if the user is a group member
390 /// with the powers requested (powers = 0 for no powers check)
391 /// </summary>
392 /// <param name="groupID"></param>
393 /// <param name="userID"></param>
394 /// <param name="powers"></param>
395 /// <returns></returns>
390 protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers) 396 protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers)
391 { 397 {
392 if (null == m_groupsModule) 398 if (null == m_groupsModule)