diff options
author | Justin Clark-Casey (justincc) | 2009-11-09 17:36:28 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2009-11-09 17:36:28 +0000 |
commit | 7f5d0a6735585d47e081cb0b717de46d5e23260d (patch) | |
tree | d463176be6e07c4bb6948f428958fe7452866758 /OpenSim/Region | |
parent | refactor out iar escaping (diff) | |
parent | remove the debug stuff (diff) | |
download | opensim-SC-7f5d0a6735585d47e081cb0b717de46d5e23260d.zip opensim-SC-7f5d0a6735585d47e081cb0b717de46d5e23260d.tar.gz opensim-SC-7f5d0a6735585d47e081cb0b717de46d5e23260d.tar.bz2 opensim-SC-7f5d0a6735585d47e081cb0b717de46d5e23260d.tar.xz |
Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim
Diffstat (limited to '')
21 files changed, 298 insertions, 73 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 34cad7b..35ccad9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3196,12 +3196,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3196 | if (!IsActive) return; // We don't need to update inactive clients. | 3196 | if (!IsActive) return; // We don't need to update inactive clients. |
3197 | 3197 | ||
3198 | CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); | 3198 | CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); |
3199 | // TODO: don't create new blocks if recycling an old packet | 3199 | loc.Header.Reliable = false; |
3200 | int total = CoarseLocations.Count; | 3200 | |
3201 | CoarseLocationUpdatePacket.IndexBlock ib = | 3201 | // Each packet can only hold around 62 avatar positions and the client clears the mini-map each time |
3202 | new CoarseLocationUpdatePacket.IndexBlock(); | 3202 | // a CoarseLocationUpdate packet is received. Oh well. |
3203 | int total = Math.Min(CoarseLocations.Count, 60); | ||
3204 | |||
3205 | CoarseLocationUpdatePacket.IndexBlock ib = new CoarseLocationUpdatePacket.IndexBlock(); | ||
3206 | |||
3203 | loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total]; | 3207 | loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total]; |
3204 | loc.AgentData = new CoarseLocationUpdatePacket.AgentDataBlock[total]; | 3208 | loc.AgentData = new CoarseLocationUpdatePacket.AgentDataBlock[total]; |
3209 | |||
3205 | int selfindex = -1; | 3210 | int selfindex = -1; |
3206 | for (int i = 0; i < total; i++) | 3211 | for (int i = 0; i < total; i++) |
3207 | { | 3212 | { |
@@ -3211,18 +3216,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3211 | lb.X = (byte)CoarseLocations[i].X; | 3216 | lb.X = (byte)CoarseLocations[i].X; |
3212 | lb.Y = (byte)CoarseLocations[i].Y; | 3217 | lb.Y = (byte)CoarseLocations[i].Y; |
3213 | 3218 | ||
3214 | lb.Z = CoarseLocations[i].Z > 1024 ? (byte)0 : (byte)(CoarseLocations[i].Z * 0.25); | 3219 | lb.Z = CoarseLocations[i].Z > 1024 ? (byte)0 : (byte)(CoarseLocations[i].Z * 0.25f); |
3215 | loc.Location[i] = lb; | 3220 | loc.Location[i] = lb; |
3216 | loc.AgentData[i] = new CoarseLocationUpdatePacket.AgentDataBlock(); | 3221 | loc.AgentData[i] = new CoarseLocationUpdatePacket.AgentDataBlock(); |
3217 | loc.AgentData[i].AgentID = users[i]; | 3222 | loc.AgentData[i].AgentID = users[i]; |
3218 | if (users[i] == AgentId) | 3223 | if (users[i] == AgentId) |
3219 | selfindex = i; | 3224 | selfindex = i; |
3220 | } | 3225 | } |
3226 | |||
3221 | ib.You = (short)selfindex; | 3227 | ib.You = (short)selfindex; |
3222 | ib.Prey = -1; | 3228 | ib.Prey = -1; |
3223 | loc.Index = ib; | 3229 | loc.Index = ib; |
3224 | loc.Header.Reliable = false; | ||
3225 | loc.Header.Zerocoded = true; | ||
3226 | 3230 | ||
3227 | OutPacket(loc, ThrottleOutPacketType.Task); | 3231 | OutPacket(loc, ThrottleOutPacketType.Task); |
3228 | } | 3232 | } |
@@ -4905,6 +4909,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4905 | /// <param name="throttlePacketType">Throttling category for the packet</param> | 4909 | /// <param name="throttlePacketType">Throttling category for the packet</param> |
4906 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType) | 4910 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType) |
4907 | { | 4911 | { |
4912 | #region BinaryStats | ||
4913 | LLUDPServer.LogPacketHeader(false, m_circuitCode, 0, packet.Type, (ushort)packet.Length); | ||
4914 | #endregion BinaryStats | ||
4915 | |||
4908 | m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, true); | 4916 | m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, true); |
4909 | } | 4917 | } |
4910 | 4918 | ||
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs index 697bbe6..adf171e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs | |||
@@ -197,11 +197,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
197 | 197 | ||
198 | private void Initialise(UUID fileID, string fileName) | 198 | private void Initialise(UUID fileID, string fileName) |
199 | { | 199 | { |
200 | m_asset = new AssetBase(); | 200 | m_asset = new AssetBase(fileID, fileName, type); |
201 | m_asset.FullID = fileID; | ||
202 | m_asset.Type = type; | ||
203 | m_asset.Data = new byte[0]; | 201 | m_asset.Data = new byte[0]; |
204 | m_asset.Name = fileName; | ||
205 | m_asset.Description = "empty"; | 202 | m_asset.Description = "empty"; |
206 | m_asset.Local = true; | 203 | m_asset.Local = true; |
207 | m_asset.Temporary = true; | 204 | m_asset.Temporary = true; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 6165984..c773c05 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.IO; | ||
30 | using System.Net; | 31 | using System.Net; |
31 | using System.Net.Sockets; | 32 | using System.Net.Sockets; |
32 | using System.Reflection; | 33 | using System.Reflection; |
@@ -204,6 +205,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
204 | TextureSendLimit = 20; | 205 | TextureSendLimit = 20; |
205 | } | 206 | } |
206 | 207 | ||
208 | #region BinaryStats | ||
209 | config = configSource.Configs["Statistics.Binary"]; | ||
210 | m_shouldCollectStats = false; | ||
211 | if (config != null) | ||
212 | { | ||
213 | if (config.Contains("enabled") && config.GetBoolean("enabled")) | ||
214 | { | ||
215 | if (config.Contains("collect_packet_headers")) | ||
216 | m_shouldCollectStats = config.GetBoolean("collect_packet_headers"); | ||
217 | if (config.Contains("packet_headers_period_seconds")) | ||
218 | { | ||
219 | binStatsMaxFilesize = TimeSpan.FromSeconds(config.GetInt("region_stats_period_seconds")); | ||
220 | } | ||
221 | if (config.Contains("stats_dir")) | ||
222 | { | ||
223 | binStatsDir = config.GetString("stats_dir"); | ||
224 | } | ||
225 | } | ||
226 | else | ||
227 | { | ||
228 | m_shouldCollectStats = false; | ||
229 | } | ||
230 | } | ||
231 | #endregion BinaryStats | ||
232 | |||
207 | m_throttle = new TokenBucket(null, sceneThrottleBps, sceneThrottleBps); | 233 | m_throttle = new TokenBucket(null, sceneThrottleBps, sceneThrottleBps); |
208 | m_throttleRates = new ThrottleRates(configSource); | 234 | m_throttleRates = new ThrottleRates(configSource); |
209 | } | 235 | } |
@@ -679,6 +705,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
679 | 705 | ||
680 | #endregion Incoming Packet Accounting | 706 | #endregion Incoming Packet Accounting |
681 | 707 | ||
708 | #region BinaryStats | ||
709 | LogPacketHeader(true, udpClient.CircuitCode, 0, packet.Type, (ushort)packet.Length); | ||
710 | #endregion BinaryStats | ||
711 | |||
682 | #region Ping Check Handling | 712 | #region Ping Check Handling |
683 | 713 | ||
684 | if (packet.Type == PacketType.StartPingCheck) | 714 | if (packet.Type == PacketType.StartPingCheck) |
@@ -700,6 +730,87 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
700 | packetInbox.Enqueue(new IncomingPacket(udpClient, packet)); | 730 | packetInbox.Enqueue(new IncomingPacket(udpClient, packet)); |
701 | } | 731 | } |
702 | 732 | ||
733 | #region BinaryStats | ||
734 | |||
735 | public class PacketLogger | ||
736 | { | ||
737 | public DateTime StartTime; | ||
738 | public string Path = null; | ||
739 | public System.IO.BinaryWriter Log = null; | ||
740 | } | ||
741 | |||
742 | public static PacketLogger PacketLog; | ||
743 | |||
744 | protected static bool m_shouldCollectStats = false; | ||
745 | // Number of seconds to log for | ||
746 | static TimeSpan binStatsMaxFilesize = TimeSpan.FromSeconds(300); | ||
747 | static object binStatsLogLock = new object(); | ||
748 | static string binStatsDir = ""; | ||
749 | |||
750 | public static void LogPacketHeader(bool incoming, uint circuit, byte flags, PacketType packetType, ushort size) | ||
751 | { | ||
752 | if (!m_shouldCollectStats) return; | ||
753 | |||
754 | // Binary logging format is TTTTTTTTCCCCFPPPSS, T=Time, C=Circuit, F=Flags, P=PacketType, S=size | ||
755 | |||
756 | // Put the incoming bit into the least significant bit of the flags byte | ||
757 | if (incoming) | ||
758 | flags |= 0x01; | ||
759 | else | ||
760 | flags &= 0xFE; | ||
761 | |||
762 | // Put the flags byte into the most significant bits of the type integer | ||
763 | uint type = (uint)packetType; | ||
764 | type |= (uint)flags << 24; | ||
765 | |||
766 | // m_log.Debug("1 LogPacketHeader(): Outside lock"); | ||
767 | lock (binStatsLogLock) | ||
768 | { | ||
769 | DateTime now = DateTime.Now; | ||
770 | |||
771 | // m_log.Debug("2 LogPacketHeader(): Inside lock. now is " + now.Ticks); | ||
772 | try | ||
773 | { | ||
774 | if (PacketLog == null || (now > PacketLog.StartTime + binStatsMaxFilesize)) | ||
775 | { | ||
776 | if (PacketLog != null && PacketLog.Log != null) | ||
777 | { | ||
778 | PacketLog.Log.Close(); | ||
779 | } | ||
780 | |||
781 | // First log file or time has expired, start writing to a new log file | ||
782 | PacketLog = new PacketLogger(); | ||
783 | PacketLog.StartTime = now; | ||
784 | PacketLog.Path = (binStatsDir.Length > 0 ? binStatsDir + System.IO.Path.DirectorySeparatorChar.ToString() : "") | ||
785 | + String.Format("packets-{0}.log", now.ToString("yyyyMMddHHmmss")); | ||
786 | PacketLog.Log = new BinaryWriter(File.Open(PacketLog.Path, FileMode.Append, FileAccess.Write)); | ||
787 | } | ||
788 | |||
789 | // Serialize the data | ||
790 | byte[] output = new byte[18]; | ||
791 | Buffer.BlockCopy(BitConverter.GetBytes(now.Ticks), 0, output, 0, 8); | ||
792 | Buffer.BlockCopy(BitConverter.GetBytes(circuit), 0, output, 8, 4); | ||
793 | Buffer.BlockCopy(BitConverter.GetBytes(type), 0, output, 12, 4); | ||
794 | Buffer.BlockCopy(BitConverter.GetBytes(size), 0, output, 16, 2); | ||
795 | |||
796 | // Write the serialized data to disk | ||
797 | if (PacketLog != null && PacketLog.Log != null) | ||
798 | PacketLog.Log.Write(output); | ||
799 | } | ||
800 | catch (Exception ex) | ||
801 | { | ||
802 | m_log.Error("Packet statistics gathering failed: " + ex.Message, ex); | ||
803 | if (PacketLog.Log != null) | ||
804 | { | ||
805 | PacketLog.Log.Close(); | ||
806 | } | ||
807 | PacketLog = null; | ||
808 | } | ||
809 | } | ||
810 | } | ||
811 | |||
812 | #endregion BinaryStats | ||
813 | |||
703 | private void HandleUseCircuitCode(object o) | 814 | private void HandleUseCircuitCode(object o) |
704 | { | 815 | { |
705 | object[] array = (object[])o; | 816 | object[] array = (object[])o; |
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index e192b81..f698ea1 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs | |||
@@ -112,11 +112,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
112 | bool storeLocal, bool tempFile) | 112 | bool storeLocal, bool tempFile) |
113 | { | 113 | { |
114 | ourClient = remoteClient; | 114 | ourClient = remoteClient; |
115 | m_asset = new AssetBase(); | 115 | m_asset = new AssetBase(assetID, "blank", type); |
116 | m_asset.FullID = assetID; | ||
117 | m_asset.Type = type; | ||
118 | m_asset.Data = data; | 116 | m_asset.Data = data; |
119 | m_asset.Name = "blank"; | ||
120 | m_asset.Description = "empty"; | 117 | m_asset.Description = "empty"; |
121 | m_asset.Local = storeLocal; | 118 | m_asset.Local = storeLocal; |
122 | m_asset.Temporary = tempFile; | 119 | m_asset.Temporary = tempFile; |
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index 13fbb60..7ac8bed 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs | |||
@@ -238,12 +238,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
238 | 238 | ||
239 | if (m_cache != null) | 239 | if (m_cache != null) |
240 | { | 240 | { |
241 | AssetBase layerDecodeAsset = new AssetBase(); | 241 | string assetID = "j2kCache_" + AssetId.ToString(); |
242 | layerDecodeAsset.ID = "j2kCache_" + AssetId.ToString(); | 242 | |
243 | AssetBase layerDecodeAsset = new AssetBase(assetID, assetID, (sbyte)AssetType.Notecard); | ||
243 | layerDecodeAsset.Local = true; | 244 | layerDecodeAsset.Local = true; |
244 | layerDecodeAsset.Name = layerDecodeAsset.ID; | ||
245 | layerDecodeAsset.Temporary = true; | 245 | layerDecodeAsset.Temporary = true; |
246 | layerDecodeAsset.Type = (sbyte)AssetType.Notecard; | ||
247 | 246 | ||
248 | #region Serialize Layer Data | 247 | #region Serialize Layer Data |
249 | 248 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 0a2e2e4..ee8b1bf 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -386,11 +386,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
386 | { | 386 | { |
387 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; | 387 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; |
388 | 388 | ||
389 | //m_log.DebugFormat("[INVENTORY ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); | 389 | if (assetType == (sbyte)AssetType.Unknown) |
390 | m_log.WarnFormat("[INVENTORY ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid); | ||
390 | 391 | ||
391 | AssetBase asset = new AssetBase(new UUID(uuid), "RandomName"); | 392 | //m_log.DebugFormat("[INVENTORY ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); |
392 | 393 | ||
393 | asset.Type = assetType; | 394 | AssetBase asset = new AssetBase(new UUID(uuid), "RandomName", assetType); |
394 | asset.Data = data; | 395 | asset.Data = data; |
395 | 396 | ||
396 | m_scene.AssetService.Store(asset); | 397 | m_scene.AssetService.Store(asset); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index bcae5f5..99d02c4 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -122,8 +122,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
122 | } | 122 | } |
123 | 123 | ||
124 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 124 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
125 | AssetBase asset1 = new AssetBase(); | 125 | AssetBase asset1 = new AssetBase(asset1Id, asset1Id.ToString(), (sbyte)AssetType.Object); |
126 | asset1.FullID = asset1Id; | ||
127 | asset1.Data = Encoding.ASCII.GetBytes(SceneObjectSerializer.ToXml2Format(object1)); | 126 | asset1.Data = Encoding.ASCII.GetBytes(SceneObjectSerializer.ToXml2Format(object1)); |
128 | scene.AssetService.Store(asset1); | 127 | scene.AssetService.Store(asset1); |
129 | 128 | ||
@@ -339,8 +338,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
339 | } | 338 | } |
340 | 339 | ||
341 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 340 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
342 | AssetBase asset1 = new AssetBase(); | 341 | AssetBase asset1 = new AssetBase(asset1Id, String.Empty, (sbyte)AssetType.Object); |
343 | asset1.FullID = asset1Id; | ||
344 | asset1.Data = Encoding.ASCII.GetBytes(SceneObjectSerializer.ToXml2Format(object1)); | 342 | asset1.Data = Encoding.ASCII.GetBytes(SceneObjectSerializer.ToXml2Format(object1)); |
345 | scene.AssetService.Store(asset1); | 343 | scene.AssetService.Store(asset1); |
346 | 344 | ||
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 9a6c49a..43761fc 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -311,11 +311,8 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
311 | } | 311 | } |
312 | 312 | ||
313 | // Create a new asset for user | 313 | // Create a new asset for user |
314 | AssetBase asset = new AssetBase(); | 314 | AssetBase asset = new AssetBase(UUID.Random(), "DynamicImage" + Util.RandomClass.Next(1, 10000), (sbyte)AssetType.Texture); |
315 | asset.FullID = UUID.Random(); | ||
316 | asset.Data = assetData; | 315 | asset.Data = assetData; |
317 | asset.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000); | ||
318 | asset.Type = 0; | ||
319 | asset.Description = String.Format("URL image : {0}", Url); | 316 | asset.Description = String.Format("URL image : {0}", Url); |
320 | asset.Local = false; | 317 | asset.Local = false; |
321 | asset.Temporary = ((Disp & DISP_TEMP) != 0); | 318 | asset.Temporary = ((Disp & DISP_TEMP) != 0); |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index c261943..70a225e 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -332,10 +332,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
332 | { | 332 | { |
333 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; | 333 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; |
334 | 334 | ||
335 | if (assetType == (sbyte)AssetType.Unknown) | ||
336 | m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid); | ||
337 | |||
335 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); | 338 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); |
336 | 339 | ||
337 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty); | 340 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType); |
338 | asset.Type = assetType; | ||
339 | asset.Data = data; | 341 | asset.Data = data; |
340 | 342 | ||
341 | // We're relying on the asset service to do the sensible thing and not store the asset if it already | 343 | // We're relying on the asset service to do the sensible thing and not store the asset if it already |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs index 5208e7a..2d2c570 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs | |||
@@ -158,9 +158,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
158 | 158 | ||
159 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); | 159 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); |
160 | 160 | ||
161 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name); | 161 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType); |
162 | asset.Description = metadata.Description; | 162 | asset.Description = metadata.Description; |
163 | asset.Type = metadata.AssetType; | ||
164 | asset.Data = data; | 163 | asset.Data = data; |
165 | 164 | ||
166 | m_cache.Store(asset); | 165 | m_cache.Store(asset); |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs index ddac515..2ff635b 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs | |||
@@ -52,16 +52,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
52 | 52 | ||
53 | public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename) | 53 | public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename) |
54 | { | 54 | { |
55 | 55 | m_asset = new AssetBase(UUID.Zero, pClientFilename, type); | |
56 | m_asset = new AssetBase(); | ||
57 | m_asset.FullID = UUID.Zero; | ||
58 | m_asset.Type = type; | ||
59 | m_asset.Data = new byte[0]; | 56 | m_asset.Data = new byte[0]; |
60 | m_asset.Name = pClientFilename; | ||
61 | m_asset.Description = "empty"; | 57 | m_asset.Description = "empty"; |
62 | m_asset.Local = true; | 58 | m_asset.Local = true; |
63 | m_asset.Temporary = true; | 59 | m_asset.Temporary = true; |
64 | |||
65 | } | 60 | } |
66 | 61 | ||
67 | public ulong XferID | 62 | public ulong XferID |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 93a949a..968f46a 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1059,9 +1059,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1059 | if (m_scene.Permissions.IsGod(remote_client.AgentId)) | 1059 | if (m_scene.Permissions.IsGod(remote_client.AgentId)) |
1060 | { | 1060 | { |
1061 | land.LandData.OwnerID = ownerID; | 1061 | land.LandData.OwnerID = ownerID; |
1062 | land.LandData.GroupID = UUID.Zero; | ||
1063 | land.LandData.IsGroupOwned = false; | ||
1062 | 1064 | ||
1063 | m_scene.ForEachClient(SendParcelOverlay); | 1065 | m_scene.ForEachClient(SendParcelOverlay); |
1064 | land.SendLandUpdateToClient(remote_client); | 1066 | land.SendLandUpdateToClient(true, remote_client); |
1065 | } | 1067 | } |
1066 | } | 1068 | } |
1067 | } | 1069 | } |
@@ -1082,8 +1084,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1082 | land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 1084 | land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
1083 | else | 1085 | else |
1084 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 1086 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
1087 | land.LandData.GroupID = UUID.Zero; | ||
1088 | land.LandData.IsGroupOwned = false; | ||
1085 | m_scene.ForEachClient(SendParcelOverlay); | 1089 | m_scene.ForEachClient(SendParcelOverlay); |
1086 | land.SendLandUpdateToClient(remote_client); | 1090 | land.SendLandUpdateToClient(true, remote_client); |
1087 | } | 1091 | } |
1088 | } | 1092 | } |
1089 | } | 1093 | } |
@@ -1105,9 +1109,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1105 | else | 1109 | else |
1106 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 1110 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
1107 | land.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); | 1111 | land.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); |
1112 | land.LandData.GroupID = UUID.Zero; | ||
1108 | land.LandData.IsGroupOwned = false; | 1113 | land.LandData.IsGroupOwned = false; |
1109 | m_scene.ForEachClient(SendParcelOverlay); | 1114 | m_scene.ForEachClient(SendParcelOverlay); |
1110 | land.SendLandUpdateToClient(remote_client); | 1115 | land.SendLandUpdateToClient(true, remote_client); |
1111 | } | 1116 | } |
1112 | } | 1117 | } |
1113 | } | 1118 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index bfe85f1..0bd225e 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -49,6 +49,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
49 | #pragma warning restore 0429 | 49 | #pragma warning restore 0429 |
50 | private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax]; | 50 | private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax]; |
51 | 51 | ||
52 | private int m_lastSeqId = 0; | ||
53 | |||
52 | protected LandData m_landData = new LandData(); | 54 | protected LandData m_landData = new LandData(); |
53 | protected Scene m_scene; | 55 | protected Scene m_scene; |
54 | protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); | 56 | protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); |
@@ -81,6 +83,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
81 | { | 83 | { |
82 | m_scene = scene; | 84 | m_scene = scene; |
83 | LandData.OwnerID = owner_id; | 85 | LandData.OwnerID = owner_id; |
86 | if (is_group_owned) | ||
87 | LandData.GroupID = owner_id; | ||
88 | else | ||
89 | LandData.GroupID = UUID.Zero; | ||
84 | LandData.IsGroupOwned = is_group_owned; | 90 | LandData.IsGroupOwned = is_group_owned; |
85 | } | 91 | } |
86 | 92 | ||
@@ -172,7 +178,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
172 | // regionFlags |= (uint)RegionFlags.AllowLandmark; | 178 | // regionFlags |= (uint)RegionFlags.AllowLandmark; |
173 | // if (landData.OwnerID == remote_client.AgentId) | 179 | // if (landData.OwnerID == remote_client.AgentId) |
174 | // regionFlags |= (uint)RegionFlags.AllowSetHome; | 180 | // regionFlags |= (uint)RegionFlags.AllowSetHome; |
175 | remote_client.SendLandProperties(sequence_id, | 181 | |
182 | int seq_id; | ||
183 | if (snap_selection && (sequence_id == 0)) | ||
184 | { | ||
185 | seq_id = m_lastSeqId; | ||
186 | } | ||
187 | else | ||
188 | { | ||
189 | seq_id = sequence_id; | ||
190 | m_lastSeqId = seq_id; | ||
191 | } | ||
192 | |||
193 | remote_client.SendLandProperties(seq_id, | ||
176 | snap_selection, request_result, LandData, | 194 | snap_selection, request_result, LandData, |
177 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, | 195 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, |
178 | GetParcelMaxPrimCount(this), | 196 | GetParcelMaxPrimCount(this), |
@@ -184,6 +202,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
184 | if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this)) | 202 | if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this)) |
185 | { | 203 | { |
186 | //Needs later group support | 204 | //Needs later group support |
205 | bool snap_selection = false; | ||
187 | LandData newData = LandData.Copy(); | 206 | LandData newData = LandData.Copy(); |
188 | 207 | ||
189 | if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) | 208 | if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) |
@@ -192,6 +211,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
192 | { | 211 | { |
193 | newData.AuthBuyerID = args.AuthBuyerID; | 212 | newData.AuthBuyerID = args.AuthBuyerID; |
194 | newData.SalePrice = args.SalePrice; | 213 | newData.SalePrice = args.SalePrice; |
214 | snap_selection = true; | ||
195 | } | 215 | } |
196 | } | 216 | } |
197 | newData.Category = args.Category; | 217 | newData.Category = args.Category; |
@@ -212,7 +232,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
212 | 232 | ||
213 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 233 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
214 | 234 | ||
215 | SendLandUpdateToAvatarsOverMe(); | 235 | SendLandUpdateToAvatarsOverMe(snap_selection); |
216 | } | 236 | } |
217 | } | 237 | } |
218 | 238 | ||
@@ -230,7 +250,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
230 | newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects); | 250 | newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects); |
231 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 251 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
232 | 252 | ||
233 | SendLandUpdateToAvatarsOverMe(); | 253 | SendLandUpdateToAvatarsOverMe(true); |
234 | } | 254 | } |
235 | 255 | ||
236 | public void DeedToGroup(UUID groupID) | 256 | public void DeedToGroup(UUID groupID) |
@@ -242,7 +262,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
242 | 262 | ||
243 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 263 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
244 | 264 | ||
245 | SendLandUpdateToAvatarsOverMe(); | 265 | SendLandUpdateToAvatarsOverMe(true); |
246 | } | 266 | } |
247 | 267 | ||
248 | public bool IsEitherBannedOrRestricted(UUID avatar) | 268 | public bool IsEitherBannedOrRestricted(UUID avatar) |
@@ -297,8 +317,18 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
297 | SendLandProperties(0, false, 0, remote_client); | 317 | SendLandProperties(0, false, 0, remote_client); |
298 | } | 318 | } |
299 | 319 | ||
320 | public void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client) | ||
321 | { | ||
322 | SendLandProperties(0, snap_selection, 0, remote_client); | ||
323 | } | ||
324 | |||
300 | public void SendLandUpdateToAvatarsOverMe() | 325 | public void SendLandUpdateToAvatarsOverMe() |
301 | { | 326 | { |
327 | SendLandUpdateToAvatarsOverMe(false); | ||
328 | } | ||
329 | |||
330 | public void SendLandUpdateToAvatarsOverMe(bool snap_selection) | ||
331 | { | ||
302 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 332 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
303 | ILandObject over = null; | 333 | ILandObject over = null; |
304 | for (int i = 0; i < avatars.Count; i++) | 334 | for (int i = 0; i < avatars.Count; i++) |
@@ -325,7 +355,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
325 | else | 355 | else |
326 | avatars[i].Invulnerable = true; | 356 | avatars[i].Invulnerable = true; |
327 | 357 | ||
328 | SendLandUpdateToClient(avatars[i].ControllingClient); | 358 | SendLandUpdateToClient(snap_selection, avatars[i].ControllingClient); |
329 | } | 359 | } |
330 | } | 360 | } |
331 | } | 361 | } |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index f4b54aa..44a651f 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -1077,14 +1077,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1077 | 1077 | ||
1078 | m_scene.RegionInfo.RegionSettings.TerrainImageID = TerrainImageUUID; | 1078 | m_scene.RegionInfo.RegionSettings.TerrainImageID = TerrainImageUUID; |
1079 | 1079 | ||
1080 | AssetBase asset = new AssetBase(); | 1080 | AssetBase asset = new AssetBase( |
1081 | asset.FullID = m_scene.RegionInfo.RegionSettings.TerrainImageID; | 1081 | m_scene.RegionInfo.RegionSettings.TerrainImageID, |
1082 | "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(), | ||
1083 | (sbyte)AssetType.Texture); | ||
1082 | asset.Data = data; | 1084 | asset.Data = data; |
1083 | asset.Name | ||
1084 | = "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(); | ||
1085 | asset.Description = m_scene.RegionInfo.RegionName; | 1085 | asset.Description = m_scene.RegionInfo.RegionName; |
1086 | |||
1087 | asset.Type = 0; | ||
1088 | asset.Temporary = temporary; | 1086 | asset.Temporary = temporary; |
1089 | m_scene.AssetService.Store(asset); | 1087 | m_scene.AssetService.Store(asset); |
1090 | } | 1088 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs index c2b1292..084184f 100644 --- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs +++ b/OpenSim/Region/Framework/Interfaces/ILandObject.cs | |||
@@ -54,6 +54,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
54 | bool IsBannedFromLand(UUID avatar); | 54 | bool IsBannedFromLand(UUID avatar); |
55 | bool IsRestrictedFromLand(UUID avatar); | 55 | bool IsRestrictedFromLand(UUID avatar); |
56 | void SendLandUpdateToClient(IClientAPI remote_client); | 56 | void SendLandUpdateToClient(IClientAPI remote_client); |
57 | void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client); | ||
57 | List<UUID> CreateAccessListArrayByFlag(AccessList flag); | 58 | List<UUID> CreateAccessListArrayByFlag(AccessList flag); |
58 | void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); | 59 | void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); |
59 | void UpdateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client); | 60 | void UpdateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client); |
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs index 7a66d23..ec50598 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs | |||
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
118 | // HGAssetService dispatches it to the remote grid. | 118 | // HGAssetService dispatches it to the remote grid. |
119 | // It's not pretty, but the best that can be done while | 119 | // It's not pretty, but the best that can be done while |
120 | // not having a global naming infrastructure | 120 | // not having a global naming infrastructure |
121 | AssetBase asset1 = new AssetBase(); | 121 | AssetBase asset1 = new AssetBase(asset.FullID, asset.Name, asset.Type); |
122 | Copy(asset, asset1); | 122 | Copy(asset, asset1); |
123 | try | 123 | try |
124 | { | 124 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index c689aba..d790041 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -626,11 +626,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
626 | /// <returns></returns> | 626 | /// <returns></returns> |
627 | private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data) | 627 | private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data) |
628 | { | 628 | { |
629 | AssetBase asset = new AssetBase(); | 629 | AssetBase asset = new AssetBase(UUID.Random(), name, assetType); |
630 | asset.Name = name; | ||
631 | asset.Description = description; | 630 | asset.Description = description; |
632 | asset.Type = assetType; | ||
633 | asset.FullID = UUID.Random(); | ||
634 | asset.Data = (data == null) ? new byte[1] : data; | 631 | asset.Data = (data == null) ? new byte[1] : data; |
635 | 632 | ||
636 | return asset; | 633 | return asset; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 093ca3e..6edef11 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -36,6 +36,7 @@ using System.Timers; | |||
36 | using System.Xml; | 36 | using System.Xml; |
37 | using Nini.Config; | 37 | using Nini.Config; |
38 | using OpenMetaverse; | 38 | using OpenMetaverse; |
39 | using OpenMetaverse.Packets; | ||
39 | using OpenMetaverse.Imaging; | 40 | using OpenMetaverse.Imaging; |
40 | using OpenSim.Framework; | 41 | using OpenSim.Framework; |
41 | using OpenSim.Services.Interfaces; | 42 | using OpenSim.Services.Interfaces; |
@@ -397,6 +398,73 @@ namespace OpenSim.Region.Framework.Scenes | |||
397 | 398 | ||
398 | #endregion | 399 | #endregion |
399 | 400 | ||
401 | #region BinaryStats | ||
402 | |||
403 | public class StatLogger | ||
404 | { | ||
405 | public DateTime StartTime; | ||
406 | public string Path; | ||
407 | public System.IO.BinaryWriter Log; | ||
408 | } | ||
409 | static StatLogger m_statLog = null; | ||
410 | static TimeSpan m_statLogPeriod = TimeSpan.FromSeconds(300); | ||
411 | static string m_statsDir = String.Empty; | ||
412 | static Object m_statLockObject = new Object(); | ||
413 | private void LogSimStats(SimStats stats) | ||
414 | { | ||
415 | SimStatsPacket pack = new SimStatsPacket(); | ||
416 | pack.Region = new SimStatsPacket.RegionBlock(); | ||
417 | pack.Region.RegionX = stats.RegionX; | ||
418 | pack.Region.RegionY = stats.RegionY; | ||
419 | pack.Region.RegionFlags = stats.RegionFlags; | ||
420 | pack.Region.ObjectCapacity = stats.ObjectCapacity; | ||
421 | //pack.Region = //stats.RegionBlock; | ||
422 | pack.Stat = stats.StatsBlock; | ||
423 | pack.Header.Reliable = false; | ||
424 | |||
425 | // note that we are inside the reporter lock when called | ||
426 | DateTime now = DateTime.Now; | ||
427 | |||
428 | // hide some time information into the packet | ||
429 | pack.Header.Sequence = (uint)now.Ticks; | ||
430 | |||
431 | lock (m_statLockObject) // m_statLog is shared so make sure there is only executer here | ||
432 | { | ||
433 | try | ||
434 | { | ||
435 | if (m_statLog == null || now > m_statLog.StartTime + m_statLogPeriod) | ||
436 | { | ||
437 | // First log file or time has expired, start writing to a new log file | ||
438 | if (m_statLog != null && m_statLog.Log != null) | ||
439 | { | ||
440 | m_statLog.Log.Close(); | ||
441 | } | ||
442 | m_statLog = new StatLogger(); | ||
443 | m_statLog.StartTime = now; | ||
444 | m_statLog.Path = (m_statsDir.Length > 0 ? m_statsDir + System.IO.Path.DirectorySeparatorChar.ToString() : "") | ||
445 | + String.Format("stats-{0}.log", now.ToString("yyyyMMddHHmmss")); | ||
446 | m_statLog.Log = new BinaryWriter(File.Open(m_statLog.Path, FileMode.Append, FileAccess.Write)); | ||
447 | } | ||
448 | |||
449 | // Write the serialized data to disk | ||
450 | if (m_statLog != null && m_statLog.Log != null) | ||
451 | m_statLog.Log.Write(pack.ToBytes()); | ||
452 | } | ||
453 | catch (Exception ex) | ||
454 | { | ||
455 | m_log.Error("statistics gathering failed: " + ex.Message, ex); | ||
456 | if (m_statLog != null && m_statLog.Log != null) | ||
457 | { | ||
458 | m_statLog.Log.Close(); | ||
459 | } | ||
460 | m_statLog = null; | ||
461 | } | ||
462 | } | ||
463 | return; | ||
464 | } | ||
465 | |||
466 | #endregion | ||
467 | |||
400 | #region Constructors | 468 | #region Constructors |
401 | 469 | ||
402 | public Scene(RegionInfo regInfo, AgentCircuitManager authen, | 470 | public Scene(RegionInfo regInfo, AgentCircuitManager authen, |
@@ -582,6 +650,38 @@ namespace OpenSim.Region.Framework.Scenes | |||
582 | } | 650 | } |
583 | 651 | ||
584 | m_log.Info("[SCENE]: Using the " + m_update_prioritization_scheme + " prioritization scheme"); | 652 | m_log.Info("[SCENE]: Using the " + m_update_prioritization_scheme + " prioritization scheme"); |
653 | |||
654 | #region BinaryStats | ||
655 | |||
656 | try | ||
657 | { | ||
658 | IConfig statConfig = m_config.Configs["Statistics.Binary"]; | ||
659 | if (statConfig.Contains("enabled") && statConfig.GetBoolean("enabled")) | ||
660 | { | ||
661 | if (statConfig.Contains("collect_region_stats")) | ||
662 | { | ||
663 | if (statConfig.GetBoolean("collect_region_stats")) | ||
664 | { | ||
665 | // if enabled, add us to the event. If not enabled, I won't get called | ||
666 | StatsReporter.OnSendStatsResult += LogSimStats; | ||
667 | } | ||
668 | } | ||
669 | if (statConfig.Contains("region_stats_period_seconds")) | ||
670 | { | ||
671 | m_statLogPeriod = TimeSpan.FromSeconds(statConfig.GetInt("region_stats_period_seconds")); | ||
672 | } | ||
673 | if (statConfig.Contains("stats_dir")) | ||
674 | { | ||
675 | m_statsDir = statConfig.GetString("stats_dir"); | ||
676 | } | ||
677 | } | ||
678 | } | ||
679 | catch | ||
680 | { | ||
681 | // if it doesn't work, we don't collect anything | ||
682 | } | ||
683 | |||
684 | #endregion BinaryStats | ||
585 | } | 685 | } |
586 | catch | 686 | catch |
587 | { | 687 | { |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1e9201e..17026e5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1918,14 +1918,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1918 | } | 1918 | } |
1919 | 1919 | ||
1920 | 1920 | ||
1921 | AssetBase Animasset = new AssetBase(); | 1921 | AssetBase Animasset = new AssetBase(UUID.Random(), "Random Animation", (sbyte)AssetType.Animation); |
1922 | Animasset.Data = anim.ToBytes(); | 1922 | Animasset.Data = anim.ToBytes(); |
1923 | Animasset.Temporary = true; | 1923 | Animasset.Temporary = true; |
1924 | Animasset.Local = true; | 1924 | Animasset.Local = true; |
1925 | Animasset.FullID = UUID.Random(); | ||
1926 | Animasset.ID = Animasset.FullID.ToString(); | ||
1927 | Animasset.Name = "Random Animation"; | ||
1928 | Animasset.Type = (sbyte)AssetType.Animation; | ||
1929 | Animasset.Description = "dance"; | 1925 | Animasset.Description = "dance"; |
1930 | //BinBVHAnimation bbvhanim = new BinBVHAnimation(Animasset.Data); | 1926 | //BinBVHAnimation bbvhanim = new BinBVHAnimation(Animasset.Data); |
1931 | 1927 | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs index 963cab5..8ea7ad3 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs | |||
@@ -49,11 +49,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
49 | 49 | ||
50 | public UUID SaveBitmap(Bitmap data, bool lossless, bool temporary) | 50 | public UUID SaveBitmap(Bitmap data, bool lossless, bool temporary) |
51 | { | 51 | { |
52 | AssetBase asset = new AssetBase(); | 52 | AssetBase asset = new AssetBase(UUID.Random(), "MRMDynamicImage", (sbyte)AssetType.Texture); |
53 | asset.FullID = UUID.Random(); | ||
54 | asset.Data = OpenJPEG.EncodeFromImage(data, lossless); | 53 | asset.Data = OpenJPEG.EncodeFromImage(data, lossless); |
55 | asset.Name = "MRMDynamicImage"; | ||
56 | asset.Type = 0; | ||
57 | asset.Description = "MRM Image"; | 54 | asset.Description = "MRM Image"; |
58 | asset.Local = false; | 55 | asset.Local = false; |
59 | asset.Temporary = temporary; | 56 | asset.Temporary = temporary; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index f1ceb80..f7ee3d9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1483,12 +1483,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1483 | m_host.AddScriptLPS(1); | 1483 | m_host.AddScriptLPS(1); |
1484 | 1484 | ||
1485 | // Create new asset | 1485 | // Create new asset |
1486 | AssetBase asset = new AssetBase(); | 1486 | AssetBase asset = new AssetBase(UUID.Random(), notecardName, (sbyte)AssetType.Notecard); |
1487 | asset.Name = notecardName; | ||
1488 | asset.Description = "Script Generated Notecard"; | 1487 | asset.Description = "Script Generated Notecard"; |
1489 | asset.Type = 7; | 1488 | string notecardData = String.Empty; |
1490 | asset.FullID = UUID.Random(); | ||
1491 | string notecardData = ""; | ||
1492 | 1489 | ||
1493 | for (int i = 0; i < contents.Length; i++) { | 1490 | for (int i = 0; i < contents.Length; i++) { |
1494 | notecardData += contents.GetLSLStringItem(i) + "\n"; | 1491 | notecardData += contents.GetLSLStringItem(i) + "\n"; |