aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2012-03-31 02:31:57 +0100
committerMelanie2012-03-31 02:31:57 +0100
commita6c26b093c3c8aa392cb0ce029527311882d23c4 (patch)
treed9a13587fe25b0b6bfd39d82724d6d534e1f1b8a
parentMerge branch 'master' into careminster (diff)
parentImplement bulk inventory update over CAPS (not recursive by design, (diff)
downloadopensim-SC_OLD-a6c26b093c3c8aa392cb0ce029527311882d23c4.zip
opensim-SC_OLD-a6c26b093c3c8aa392cb0ce029527311882d23c4.tar.gz
opensim-SC_OLD-a6c26b093c3c8aa392cb0ce029527311882d23c4.tar.bz2
opensim-SC_OLD-a6c26b093c3c8aa392cb0ce029527311882d23c4.tar.xz
Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs48
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs19
-rw-r--r--OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs30
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs10
4 files changed, 90 insertions, 17 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 0496b7d..3118613 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -12454,7 +12454,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12454 ItemData.Add(ItemDataMap); 12454 ItemData.Add(ItemDataMap);
12455 } 12455 }
12456 12456
12457 llsd.Add("ItemData", ItemData); 12457 llsd.Add("InventoryData", ItemData);
12458 12458
12459 eq.Enqueue(BuildEvent("RemoveInventoryItem", 12459 eq.Enqueue(BuildEvent("RemoveInventoryItem",
12460 llsd), AgentId); 12460 llsd), AgentId);
@@ -12498,6 +12498,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12498 llsd), AgentId); 12498 llsd), AgentId);
12499 } 12499 }
12500 12500
12501 private byte[] EncodeU32(uint val)
12502 {
12503 byte[] ret = BitConverter.GetBytes(val);
12504 if (BitConverter.IsLittleEndian)
12505 Array.Reverse(ret);
12506 return ret;
12507 }
12508
12501 public void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items) 12509 public void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items)
12502 { 12510 {
12503 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); 12511 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
@@ -12513,6 +12521,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12513 OSDMap AgentDataMap = new OSDMap(1); 12521 OSDMap AgentDataMap = new OSDMap(1);
12514 AgentDataMap.Add("AgentID", OSD.FromUUID(AgentId)); 12522 AgentDataMap.Add("AgentID", OSD.FromUUID(AgentId));
12515 AgentDataMap.Add("SessionID", OSD.FromUUID(SessionId)); 12523 AgentDataMap.Add("SessionID", OSD.FromUUID(SessionId));
12524 AgentDataMap.Add("TransactionID", OSD.FromUUID(UUID.Random()));
12516 12525
12517 OSDArray AgentData = new OSDArray(1); 12526 OSDArray AgentData = new OSDArray(1);
12518 AgentData.Add(AgentDataMap); 12527 AgentData.Add(AgentDataMap);
@@ -12540,10 +12549,47 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12540 foreach (InventoryItemBase item in items) 12549 foreach (InventoryItemBase item in items)
12541 { 12550 {
12542 OSDMap ItemDataMap = new OSDMap(); 12551 OSDMap ItemDataMap = new OSDMap();
12552
12553 ItemDataMap.Add("ItemID", OSD.FromUUID(item.ID));
12554 ItemDataMap.Add("FolderID", OSD.FromUUID(item.Folder));
12555
12556 ItemDataMap.Add("CreatorID", OSD.FromUUID(item.CreatorIdAsUuid));
12557 ItemDataMap.Add("OwnerID", OSD.FromUUID(item.Owner));
12558 ItemDataMap.Add("GroupID", OSD.FromUUID(item.GroupID));
12559 ItemDataMap.Add("BaseMask", OSD.FromBinary(EncodeU32((uint)item.BasePermissions)));
12560 ItemDataMap.Add("OwnerMask", OSD.FromBinary(EncodeU32((uint)item.CurrentPermissions)));
12561 ItemDataMap.Add("GroupMask", OSD.FromBinary(EncodeU32((uint)item.GroupPermissions)));
12562 ItemDataMap.Add("EveryoneMask", OSD.FromBinary(EncodeU32((uint)item.EveryOnePermissions)));
12563 ItemDataMap.Add("NextOwnerMask", OSD.FromBinary(EncodeU32((uint)item.NextPermissions)));
12564 ItemDataMap.Add("GroupOwned", OSD.FromBoolean(item.GroupOwned));
12565 ItemDataMap.Add("AssetID", OSD.FromUUID(item.AssetID));
12566 ItemDataMap.Add("Type", OSD.FromInteger(item.AssetType));
12567 ItemDataMap.Add("InvType", OSD.FromInteger(item.InvType));
12568 ItemDataMap.Add("Flags", OSD.FromBinary(EncodeU32((uint)item.Flags)));
12569 ItemDataMap.Add("SaleType", OSD.FromInteger((byte)item.SaleType));
12570 ItemDataMap.Add("SalePrice", OSD.FromInteger(item.SalePrice));
12571 ItemDataMap.Add("Name", OSD.FromString(item.Name));
12572 ItemDataMap.Add("Description", OSD.FromString(item.Description));
12573 ItemDataMap.Add("CreationDate", OSD.FromInteger(item.CreationDate));
12574
12575 ItemDataMap.Add("CRC", OSD.FromBinary(EncodeU32(
12576 Helpers.InventoryCRC(1000, 0, (sbyte)item.InvType,
12577 (sbyte)item.AssetType, item.AssetID,
12578 item.GroupID, 100,
12579 item.Owner, item.CreatorIdAsUuid,
12580 item.ID, item.Folder,
12581 (uint)PermissionMask.All, 1, (uint)PermissionMask.All, (uint)PermissionMask.All,
12582 (uint)PermissionMask.All)
12583 )));
12584 ItemDataMap.Add("CallbackID", 0);
12585
12543 ItemData.Add(ItemDataMap); 12586 ItemData.Add(ItemDataMap);
12544 } 12587 }
12545 12588
12546 llsd.Add("ItemData", ItemData); 12589 llsd.Add("ItemData", ItemData);
12590
12591 eq.Enqueue(BuildEvent("BulkUpdateInventory",
12592 llsd), AgentId);
12547 } 12593 }
12548 } 12594 }
12549} 12595}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
index 6d3ace9..3b862da 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
@@ -93,8 +93,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
93 if (config == null) 93 if (config == null)
94 return; 94 return;
95 95
96 int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime")); 96 int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime", "-1"));
97 if (refreshminutes <= 0) 97 if (refreshminutes < 0)
98 { 98 {
99 m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: No refresh time given in config. Module disabled."); 99 m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: No refresh time given in config. Module disabled.");
100 return; 100 return;
@@ -117,12 +117,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
117 return; 117 return;
118 } 118 }
119 119
120 m_refreshTimer.Enabled = true; 120 if (m_refreshtime > 0)
121 m_refreshTimer.AutoReset = true; 121 {
122 m_refreshTimer.Interval = m_refreshtime; 122 m_refreshTimer.Enabled = true;
123 m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh); 123 m_refreshTimer.AutoReset = true;
124 m_refreshTimer.Interval = m_refreshtime;
125 m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh);
126 }
124 127
125 m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0}min and service object {1}", 128 m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}",
126 refreshminutes, service); 129 refreshminutes, service);
127 130
128 m_enabled = true; 131 m_enabled = true;
@@ -238,4 +241,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
238 } 241 }
239 } 242 }
240 } 243 }
241} \ No newline at end of file 244}
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
index 6163fd1..e6f2855 100644
--- a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
@@ -64,6 +64,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
64 private bool m_useAntiAliasing = false; // TODO: Make this a config option 64 private bool m_useAntiAliasing = false; // TODO: Make this a config option
65 private bool m_Enabled = false; 65 private bool m_Enabled = false;
66 66
67 private Bitmap lastImage = null;
68 private DateTime lastImageTime = DateTime.MinValue;
69
67 #region IRegionModule Members 70 #region IRegionModule Members
68 71
69 public void Initialise(IConfigSource source) 72 public void Initialise(IConfigSource source)
@@ -86,14 +89,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
86 89
87 List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); 90 List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory());
88 if (renderers.Count > 0) 91 if (renderers.Count > 0)
89 { 92 m_log.Info("[MAPTILE]: Loaded prim mesher " + renderers[0]);
90 m_primMesher = RenderingLoader.LoadRenderer(renderers[0]);
91 m_log.Info("[MAPTILE]: Loaded prim mesher " + m_primMesher.ToString());
92 }
93 else 93 else
94 {
95 m_log.Info("[MAPTILE]: No prim mesher loaded, prim rendering will be disabled"); 94 m_log.Info("[MAPTILE]: No prim mesher loaded, prim rendering will be disabled");
96 }
97 95
98 m_scene.RegisterModuleInterface<IMapImageGenerator>(this); 96 m_scene.RegisterModuleInterface<IMapImageGenerator>(this);
99 } 97 }
@@ -126,9 +124,25 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
126 124
127 public Bitmap CreateMapTile() 125 public Bitmap CreateMapTile()
128 { 126 {
127 if ((DateTime.Now - lastImageTime).TotalSeconds < 3600)
128 {
129 return lastImage.Clone(new Rectangle(0, 0, 256, 256), lastImage.PixelFormat);
130 }
131
132 List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory());
133 if (renderers.Count > 0)
134 {
135 m_primMesher = RenderingLoader.LoadRenderer(renderers[0]);
136 }
137
129 Vector3 camPos = new Vector3(127.5f, 127.5f, 221.7025033688163f); 138 Vector3 camPos = new Vector3(127.5f, 127.5f, 221.7025033688163f);
130 Viewport viewport = new Viewport(camPos, -Vector3.UnitZ, 1024f, 0.1f, (int)Constants.RegionSize, (int)Constants.RegionSize, (float)Constants.RegionSize, (float)Constants.RegionSize); 139 Viewport viewport = new Viewport(camPos, -Vector3.UnitZ, 1024f, 0.1f, (int)Constants.RegionSize, (int)Constants.RegionSize, (float)Constants.RegionSize, (float)Constants.RegionSize);
131 return CreateMapTile(viewport, false); 140 Bitmap tile = CreateMapTile(viewport, false);
141 m_primMesher = null;
142
143 lastImage = tile;
144 lastImageTime = DateTime.Now;
145 return lastImage.Clone(new Rectangle(0, 0, 256, 256), lastImage.PixelFormat);
132 } 146 }
133 147
134 public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures) 148 public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures)
@@ -655,4 +669,4 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
655 return result; 669 return result;
656 } 670 }
657 } 671 }
658} \ No newline at end of file 672}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index edfc0ef..ce05b8c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4680,12 +4680,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4680 // agent must not be a god 4680 // agent must not be a god
4681 if (presence.GodLevel >= 200) return; 4681 if (presence.GodLevel >= 200) return;
4682 4682
4683 if (simname == String.Empty)
4684 simname = World.RegionInfo.RegionName;
4685
4683 // agent must be over the owners land 4686 // agent must be over the owners land
4684 if (m_host.OwnerID == World.LandChannel.GetLandObject( 4687 if (m_host.OwnerID == World.LandChannel.GetLandObject(
4685 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 4688 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
4686 { 4689 {
4687 World.RequestTeleportLocation(presence.ControllingClient, simname, new Vector3((float)pos.x, (float)pos.y, (float)pos.z), new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z), (uint)TeleportFlags.ViaLocation); 4690 World.RequestTeleportLocation(presence.ControllingClient, simname, new Vector3((float)pos.x, (float)pos.y, (float)pos.z), new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z), (uint)TeleportFlags.ViaLocation);
4688 } 4691 }
4692 else // or must be wearing the prim
4693 {
4694 if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID)
4695 {
4696 World.RequestTeleportLocation(presence.ControllingClient, simname, new Vector3((float)pos.x, (float)pos.y, (float)pos.z), new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z), (uint)TeleportFlags.ViaLocation);
4697 }
4698 }
4689 } 4699 }
4690 } 4700 }
4691 } 4701 }