aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2010-09-02 16:36:43 -0700
committerDiva Canto2010-09-02 16:36:43 -0700
commit21c5377af998bdd2c6a442588195a7af4d21fa48 (patch)
tree149e6d3dbeb5b3061bd5625763dfb388a50ed47b /OpenSim
parentQuick fix for making global references for gatekeepers that are not domain:po... (diff)
parentRemove commented code and the comment, as the change has proven out (diff)
downloadopensim-SC_OLD-21c5377af998bdd2c6a442588195a7af4d21fa48.zip
opensim-SC_OLD-21c5377af998bdd2c6a442588195a7af4d21fa48.tar.gz
opensim-SC_OLD-21c5377af998bdd2c6a442588195a7af4d21fa48.tar.bz2
opensim-SC_OLD-21c5377af998bdd2c6a442588195a7af4d21fa48.tar.xz
Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/MySQL/MySQLLegacyRegionData.cs22
-rw-r--r--OpenSim/Data/MySQL/Resources/RegionStore.migrations14
-rw-r--r--OpenSim/Data/SQLite/Resources/019_RegionStore.sql5
-rw-r--r--OpenSim/Data/SQLite/Resources/020_RegionStore.sql6
-rw-r--r--OpenSim/Data/SQLite/Resources/RegionStore.migrations21
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs6
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs105
-rw-r--r--OpenSim/Framework/LandData.cs104
-rw-r--r--OpenSim/Framework/LandUpdateArgs.cs7
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs10
-rw-r--r--OpenSim/Region/Application/OpenSim.cs8
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs5
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs185
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs95
-rw-r--r--OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs18
-rw-r--r--OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs120
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs65
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs7
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEventQueue.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs71
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs22
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs8
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs24
27 files changed, 616 insertions, 323 deletions
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
index 37d7a88..04446ce 100644
--- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
@@ -677,7 +677,8 @@ namespace OpenSim.Data.MySQL
677 "MusicURL, PassHours, PassPrice, SnapshotUUID, " + 677 "MusicURL, PassHours, PassPrice, SnapshotUUID, " +
678 "UserLocationX, UserLocationY, UserLocationZ, " + 678 "UserLocationX, UserLocationY, UserLocationZ, " +
679 "UserLookAtX, UserLookAtY, UserLookAtZ, " + 679 "UserLookAtX, UserLookAtY, UserLookAtZ, " +
680 "AuthbuyerID, OtherCleanTime, Dwell) values (" + 680 "AuthbuyerID, OtherCleanTime, Dwell, MediaType, MediaDescription, " +
681 "MediaSize, MediaLoop, ObscureMusic, ObscureMedia) values (" +
681 "?UUID, ?RegionUUID, " + 682 "?UUID, ?RegionUUID, " +
682 "?LocalLandID, ?Bitmap, ?Name, ?Description, " + 683 "?LocalLandID, ?Bitmap, ?Name, ?Description, " +
683 "?OwnerUUID, ?IsGroupOwned, ?Area, ?AuctionID, " + 684 "?OwnerUUID, ?IsGroupOwned, ?Area, ?AuctionID, " +
@@ -687,7 +688,8 @@ namespace OpenSim.Data.MySQL
687 "?MusicURL, ?PassHours, ?PassPrice, ?SnapshotUUID, " + 688 "?MusicURL, ?PassHours, ?PassPrice, ?SnapshotUUID, " +
688 "?UserLocationX, ?UserLocationY, ?UserLocationZ, " + 689 "?UserLocationX, ?UserLocationY, ?UserLocationZ, " +
689 "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " + 690 "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " +
690 "?AuthbuyerID, ?OtherCleanTime, ?Dwell)"; 691 "?AuthbuyerID, ?OtherCleanTime, ?Dwell, ?MediaType, ?MediaDescription, "+
692 "CONCAT(?MediaWidth, ',', ?MediaHeight), ?MediaLoop, ?ObscureMusic, ?ObscureMedia)";
691 693
692 FillLandCommand(cmd, parcel.LandData, parcel.RegionUUID); 694 FillLandCommand(cmd, parcel.LandData, parcel.RegionUUID);
693 695
@@ -1347,6 +1349,14 @@ namespace OpenSim.Data.MySQL
1347 m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); 1349 m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name);
1348 } 1350 }
1349 1351
1352 newData.MediaDescription = (string) row["MediaDescription"];
1353 newData.MediaType = (string) row["MediaType"];
1354 newData.MediaWidth = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[0]);
1355 newData.MediaHeight = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[1]);
1356 newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]);
1357 newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
1358 newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
1359
1350 newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); 1360 newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
1351 1361
1352 return newData; 1362 return newData;
@@ -1651,6 +1661,14 @@ namespace OpenSim.Data.MySQL
1651 cmd.Parameters.AddWithValue("AuthBuyerID", land.AuthBuyerID); 1661 cmd.Parameters.AddWithValue("AuthBuyerID", land.AuthBuyerID);
1652 cmd.Parameters.AddWithValue("OtherCleanTime", land.OtherCleanTime); 1662 cmd.Parameters.AddWithValue("OtherCleanTime", land.OtherCleanTime);
1653 cmd.Parameters.AddWithValue("Dwell", land.Dwell); 1663 cmd.Parameters.AddWithValue("Dwell", land.Dwell);
1664 cmd.Parameters.AddWithValue("MediaDescription", land.MediaDescription);
1665 cmd.Parameters.AddWithValue("MediaType", land.MediaType);
1666 cmd.Parameters.AddWithValue("MediaWidth", land.MediaWidth);
1667 cmd.Parameters.AddWithValue("MediaHeight", land.MediaHeight);
1668 cmd.Parameters.AddWithValue("MediaLoop", land.MediaLoop);
1669 cmd.Parameters.AddWithValue("ObscureMusic", land.ObscureMusic);
1670 cmd.Parameters.AddWithValue("ObscureMedia", land.ObscureMedia);
1671
1654 } 1672 }
1655 1673
1656 /// <summary> 1674 /// <summary>
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
index 1369704..1405207 100644
--- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
@@ -801,9 +801,19 @@ ALTER TABLE `regionwindlight` CHANGE COLUMN `cloud_scroll_x` `cloud_scroll_x` F
801COMMIT; 801COMMIT;
802 802
803:VERSION 35 #--------------------- 803:VERSION 35 #---------------------
804-- Added post 0.7
805 804
806BEGIN; 805BEGIN;
807ALTER TABLE prims ADD COLUMN MediaURL varchar(255); 806ALTER TABLE prims ADD COLUMN MediaURL varchar(255);
808ALTER TABLE primshapes ADD COLUMN Media TEXT; 807ALTER TABLE primshapes ADD COLUMN Media TEXT;
809COMMIT; \ No newline at end of file 808COMMIT;
809
810:VERSION 36 #---------------------
811
812BEGIN;
813ALTER TABLE `land` ADD COLUMN `MediaType` VARCHAR(32) NOT NULL DEFAULT 'none/none' ;
814ALTER TABLE `land` ADD COLUMN `MediaDescription` VARCHAR(255) NOT NULL DEFAULT '';
815ALTER TABLE `land` ADD COLUMN `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0';
816ALTER TABLE `land` ADD COLUMN `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE;
817ALTER TABLE `land` ADD COLUMN `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE;
818ALTER TABLE `land` ADD COLUMN `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE;
819COMMIT;
diff --git a/OpenSim/Data/SQLite/Resources/019_RegionStore.sql b/OpenSim/Data/SQLite/Resources/019_RegionStore.sql
deleted file mode 100644
index d62f848..0000000
--- a/OpenSim/Data/SQLite/Resources/019_RegionStore.sql
+++ /dev/null
@@ -1,5 +0,0 @@
1BEGIN;
2
3ALTER TABLE regionsettings ADD COLUMN map_tile_ID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000';
4
5COMMIT; \ No newline at end of file
diff --git a/OpenSim/Data/SQLite/Resources/020_RegionStore.sql b/OpenSim/Data/SQLite/Resources/020_RegionStore.sql
deleted file mode 100644
index 39cb752..0000000
--- a/OpenSim/Data/SQLite/Resources/020_RegionStore.sql
+++ /dev/null
@@ -1,6 +0,0 @@
1BEGIN;
2
3ALTER TABLE prims ADD COLUMN MediaURL varchar(255);
4ALTER TABLE primshapes ADD COLUMN Media TEXT;
5
6COMMIT; \ No newline at end of file
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
index c461bf0..5e2045b 100644
--- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations
+++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
@@ -446,3 +446,24 @@ update land
446 where AuthbuyerID not like '%-%'; 446 where AuthbuyerID not like '%-%';
447 447
448COMMIT; 448COMMIT;
449
450:VERSION 19
451BEGIN;
452ALTER TABLE regionsettings ADD COLUMN map_tile_ID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000';
453COMMIT;
454
455:VERSION 20
456BEGIN;
457ALTER TABLE prims ADD COLUMN MediaURL varchar(255);
458ALTER TABLE primshapes ADD COLUMN Media TEXT;
459COMMIT;
460
461:VERSION 21
462BEGIN;
463ALTER TABLE `land` ADD COLUMN `MediaType` VARCHAR(32) NOT NULL DEFAULT 'none/none';
464ALTER TABLE `land` ADD COLUMN `MediaDescription` VARCHAR(255) NOT NULL DEFAULT '';
465ALTER TABLE `land` ADD COLUMN `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0';
466ALTER TABLE `land` ADD COLUMN `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE;
467ALTER TABLE `land` ADD COLUMN `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE;
468ALTER TABLE `land` ADD COLUMN `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE;
469COMMIT; \ No newline at end of file
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 4208050..8432e74 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -1762,6 +1762,12 @@ namespace OpenSim.Data.SQLite
1762 row["AuthbuyerID"] = land.AuthBuyerID.ToString(); 1762 row["AuthbuyerID"] = land.AuthBuyerID.ToString();
1763 row["OtherCleanTime"] = land.OtherCleanTime; 1763 row["OtherCleanTime"] = land.OtherCleanTime;
1764 row["Dwell"] = land.Dwell; 1764 row["Dwell"] = land.Dwell;
1765 row["MediaType"] = land.MediaType;
1766 row["MediaDescription"] = land.MediaDescription;
1767 row["MediaSize"] = land.MediaWidth.ToString() + "," + land.MediaHeight.ToString();
1768 row["MediaLoop"] = land.MediaLoop.ToString();
1769 row["ObscureMusic"] = land.ObscureMusic.ToString();
1770 row["ObscureMedia"] = land.ObscureMedia.ToString();
1765 } 1771 }
1766 1772
1767 /// <summary> 1773 /// <summary>
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index 0db7bb9..8a339fe 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Framework.Capabilities
44 string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder, 44 string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder,
45 byte[] data, string inventoryType, string assetType); 45 byte[] data, string inventoryType, string assetType);
46 46
47 public delegate void UploadedBakedTexture(UUID assetID, byte[] data);
48
47 public delegate UUID UpdateItem(UUID itemID, byte[] data); 49 public delegate UUID UpdateItem(UUID itemID, byte[] data);
48 50
49 public delegate void UpdateTaskScript(UUID itemID, UUID primID, bool isScriptRunning, byte[] data, ref ArrayList errors); 51 public delegate void UpdateTaskScript(UUID itemID, UUID primID, bool isScriptRunning, byte[] data, ref ArrayList errors);
@@ -97,6 +99,7 @@ namespace OpenSim.Framework.Capabilities
97 // private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module. 99 // private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module.
98 100
99 // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. 101 // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
102 private static readonly string m_uploadBakedTexturePath = "0010/";// This is in the LandManagementModule.
100 103
101 //private string eventQueue = "0100/"; 104 //private string eventQueue = "0100/";
102 private IScene m_Scene; 105 private IScene m_Scene;
@@ -185,6 +188,8 @@ namespace OpenSim.Framework.Capabilities
185 m_capsHandlers["UpdateScriptTaskInventory"] = 188 m_capsHandlers["UpdateScriptTaskInventory"] =
186 new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory); 189 new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory);
187 m_capsHandlers["UpdateScriptTask"] = m_capsHandlers["UpdateScriptTaskInventory"]; 190 m_capsHandlers["UpdateScriptTask"] = m_capsHandlers["UpdateScriptTaskInventory"];
191 m_capsHandlers["UploadBakedTexture"] =
192 new RestStreamHandler("POST", capsBase + m_uploadBakedTexturePath, UploadBakedTexture);
188 193
189 } 194 }
190 catch (Exception e) 195 catch (Exception e)
@@ -742,6 +747,50 @@ namespace OpenSim.Framework.Capabilities
742 return null; 747 return null;
743 } 748 }
744 749
750 public string UploadBakedTexture(string request, string path,
751 string param, OSHttpRequest httpRequest,
752 OSHttpResponse httpResponse)
753 {
754 try
755 {
756 m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " +
757 m_regionName);
758
759 string capsBase = "/CAPS/" + m_capsObjectPath;
760 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
761
762 BakedTextureUploader uploader =
763 new BakedTextureUploader( capsBase + uploaderPath,
764 m_httpListener);
765 uploader.OnUpLoad += BakedTextureUploaded;
766
767 m_httpListener.AddStreamHandler(
768 new BinaryStreamHandler("POST", capsBase + uploaderPath,
769 uploader.uploaderCaps));
770
771 string protocol = "http://";
772
773 if (m_httpListener.UseSSL)
774 protocol = "https://";
775
776 string uploaderURL = protocol + m_httpListenerHostName + ":" +
777 m_httpListenPort.ToString() + capsBase + uploaderPath;
778
779 LLSDAssetUploadResponse uploadResponse =
780 new LLSDAssetUploadResponse();
781 uploadResponse.uploader = uploaderURL;
782 uploadResponse.state = "upload";
783
784 return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
785 }
786 catch (Exception e)
787 {
788 m_log.Error("[CAPS]: " + e.ToString());
789 }
790
791 return null;
792 }
793
745 /// <summary> 794 /// <summary>
746 /// Called by the notecard update handler. Provides a URL to which the client can upload a new asset. 795 /// Called by the notecard update handler. Provides a URL to which the client can upload a new asset.
747 /// </summary> 796 /// </summary>
@@ -925,6 +974,17 @@ namespace OpenSim.Framework.Capabilities
925 } 974 }
926 } 975 }
927 976
977 public void BakedTextureUploaded(UUID assetID, byte[] data)
978 {
979 m_log.DebugFormat("[CAPS]: Received baked texture {0}", assetID.ToString());
980 AssetBase asset;
981 asset = new AssetBase(assetID, "Baked Texture", (sbyte)AssetType.Texture, m_agentID.ToString());
982 asset.Data = data;
983 asset.Temporary = true;
984 asset.Local = true;
985 m_assetCache.Store(asset);
986 }
987
928 /// <summary> 988 /// <summary>
929 /// Called when new asset data for an agent inventory item update has been uploaded. 989 /// Called when new asset data for an agent inventory item update has been uploaded.
930 /// </summary> 990 /// </summary>
@@ -1243,5 +1303,50 @@ namespace OpenSim.Framework.Capabilities
1243 fs.Close(); 1303 fs.Close();
1244 } 1304 }
1245 } 1305 }
1306
1307 public class BakedTextureUploader
1308 {
1309 public event UploadedBakedTexture OnUpLoad;
1310 private UploadedBakedTexture handlerUpLoad = null;
1311
1312 private string uploaderPath = String.Empty;
1313 private UUID newAssetID;
1314 private IHttpServer httpListener;
1315
1316 public BakedTextureUploader(string path, IHttpServer httpServer)
1317 {
1318 newAssetID = UUID.Random();
1319 uploaderPath = path;
1320 httpListener = httpServer;
1321 }
1322
1323 /// <summary>
1324 ///
1325 /// </summary>
1326 /// <param name="data"></param>
1327 /// <param name="path"></param>
1328 /// <param name="param"></param>
1329 /// <returns></returns>
1330 public string uploaderCaps(byte[] data, string path, string param)
1331 {
1332 string res = String.Empty;
1333 LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete();
1334 uploadComplete.new_asset = newAssetID.ToString();
1335 uploadComplete.new_inventory_item = UUID.Zero;
1336 uploadComplete.state = "complete";
1337
1338 res = LLSDHelpers.SerialiseLLSDReply(uploadComplete);
1339
1340 httpListener.RemoveStreamHandler("POST", uploaderPath);
1341
1342 handlerUpLoad = OnUpLoad;
1343 if (handlerUpLoad != null)
1344 {
1345 handlerUpLoad(newAssetID, data);
1346 }
1347
1348 return res;
1349 }
1350 }
1246 } 1351 }
1247} 1352}
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs
index 060e886..f263e67 100644
--- a/OpenSim/Framework/LandData.cs
+++ b/OpenSim/Framework/LandData.cs
@@ -90,6 +90,78 @@ namespace OpenSim.Framework
90 private Vector3 _userLookAt = new Vector3(); 90 private Vector3 _userLookAt = new Vector3();
91 private int _dwell = 0; 91 private int _dwell = 0;
92 private int _otherCleanTime = 0; 92 private int _otherCleanTime = 0;
93 private string _mediaType = "none/none";
94 private string _mediaDescription = "";
95 private int _mediaHeight = 0;
96 private int _mediaWidth = 0;
97 private bool _mediaLoop = false;
98 private bool _obscureMusic = false;
99 private bool _obscureMedia = false;
100
101 /// <summary>
102 /// Whether to obscure parcel media URL
103 /// </summary>
104 [XmlIgnore]
105 public bool ObscureMedia {
106 get {
107 return _obscureMedia;
108 }
109 set {
110 _obscureMedia = value;
111 }
112 }
113
114 /// <summary>
115 /// Whether to obscure parcel music URL
116 /// </summary>
117 [XmlIgnore]
118 public bool ObscureMusic {
119 get {
120 return _obscureMusic;
121 }
122 set {
123 _obscureMusic = value;
124 }
125 }
126
127 /// <summary>
128 /// Whether to loop parcel media
129 /// </summary>
130 [XmlIgnore]
131 public bool MediaLoop {
132 get {
133 return _mediaLoop;
134 }
135 set {
136 _mediaLoop = value;
137 }
138 }
139
140 /// <summary>
141 /// Height of parcel media render
142 /// </summary>
143 [XmlIgnore]
144 public int MediaHeight {
145 get {
146 return _mediaHeight;
147 }
148 set {
149 _mediaHeight = value;
150 }
151 }
152
153 /// <summary>
154 /// Width of parcel media render
155 /// </summary>
156 [XmlIgnore]
157 public int MediaWidth {
158 get {
159 return _mediaWidth;
160 }
161 set {
162 _mediaWidth = value;
163 }
164 }
93 165
94 /// <summary> 166 /// <summary>
95 /// Upper corner of the AABB for the parcel 167 /// Upper corner of the AABB for the parcel
@@ -358,20 +430,6 @@ namespace OpenSim.Framework
358 } 430 }
359 } 431 }
360 432
361 private int[] _mediaSize = new int[2];
362 public int[] MediaSize
363 {
364 get
365 {
366 return _mediaSize;
367 }
368 set
369 {
370 _mediaSize = value;
371 }
372 }
373
374 private string _mediaType = "";
375 public string MediaType 433 public string MediaType
376 { 434 {
377 get 435 get
@@ -586,6 +644,17 @@ namespace OpenSim.Framework
586 } 644 }
587 } 645 }
588 646
647 /// <summary>
648 /// parcel media description
649 /// </summary>
650 public string MediaDescription {
651 get {
652 return _mediaDescription;
653 }
654 set {
655 _mediaDescription = value;
656 }
657 }
589 658
590 public LandData() 659 public LandData()
591 { 660 {
@@ -635,6 +704,13 @@ namespace OpenSim.Framework
635 landData._userLookAt = _userLookAt; 704 landData._userLookAt = _userLookAt;
636 landData._otherCleanTime = _otherCleanTime; 705 landData._otherCleanTime = _otherCleanTime;
637 landData._dwell = _dwell; 706 landData._dwell = _dwell;
707 landData._mediaType = _mediaType;
708 landData._mediaDescription = _mediaDescription;
709 landData._mediaWidth = _mediaWidth;
710 landData._mediaHeight = _mediaHeight;
711 landData._mediaLoop = _mediaLoop;
712 landData._obscureMusic = _obscureMusic;
713 landData._obscureMedia = _obscureMedia;
638 714
639 landData._parcelAccessList.Clear(); 715 landData._parcelAccessList.Clear();
640 foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList) 716 foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList)
diff --git a/OpenSim/Framework/LandUpdateArgs.cs b/OpenSim/Framework/LandUpdateArgs.cs
index 9760a1d..ed496a1 100644
--- a/OpenSim/Framework/LandUpdateArgs.cs
+++ b/OpenSim/Framework/LandUpdateArgs.cs
@@ -49,5 +49,12 @@ namespace OpenSim.Framework
49 public UUID SnapshotID; 49 public UUID SnapshotID;
50 public Vector3 UserLocation; 50 public Vector3 UserLocation;
51 public Vector3 UserLookAt; 51 public Vector3 UserLookAt;
52 public string MediaType;
53 public string MediaDescription;
54 public int MediaHeight;
55 public int MediaWidth;
56 public bool MediaLoop;
57 public bool ObscureMusic;
58 public bool ObscureMedia;
52 } 59 }
53} 60}
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 016ab73..95c3e6c 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -338,19 +338,25 @@ namespace OpenSim.Framework.Servers.HttpServer
338 // HandleRequest(request,resp); 338 // HandleRequest(request,resp);
339 // } 339 // }
340 340
341 /// <summary>
342 /// This methods is the start of incoming HTTP request handling.
343 /// </summary>
344 /// <param name="request"></param>
345 /// <param name="response"></param>
341 public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response) 346 public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response)
342 { 347 {
343 try 348 try
344 { 349 {
350// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl);
351
345 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); 352 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true);
353
346 // This is the REST agent interface. We require an agent to properly identify 354 // This is the REST agent interface. We require an agent to properly identify
347 // itself. If the REST handler recognizes the prefix it will attempt to 355 // itself. If the REST handler recognizes the prefix it will attempt to
348 // satisfy the request. If it is not recognizable, and no damage has occurred 356 // satisfy the request. If it is not recognizable, and no damage has occurred
349 // the request can be passed through to the other handlers. This is a low 357 // the request can be passed through to the other handlers. This is a low
350 // probability event; if a request is matched it is normally expected to be 358 // probability event; if a request is matched it is normally expected to be
351 // handled 359 // handled
352// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl);
353
354 IHttpAgentHandler agentHandler; 360 IHttpAgentHandler agentHandler;
355 361
356 if (TryGetAgentHandler(request, response, out agentHandler)) 362 if (TryGetAgentHandler(request, response, out agentHandler))
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 6834606..3c2575d 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -218,7 +218,13 @@ namespace OpenSim
218 218
219 m_console.Commands.AddCommand("region", false, "debug packet", 219 m_console.Commands.AddCommand("region", false, "debug packet",
220 "debug packet <level>", 220 "debug packet <level>",
221 "Turn on packet debugging", Debug); 221 "Turn on packet debugging",
222 "If level > 255 then all incoming and outgoing packets are logged.\n"
223 + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n"
224 + "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n"
225 + "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n"
226 + "If level <= 0 then no packets are logged.",
227 Debug);
222 228
223 m_console.Commands.AddCommand("region", false, "debug scene", 229 m_console.Commands.AddCommand("region", false, "debug scene",
224 "debug scene <cripting> <collisions> <physics>", 230 "debug scene <cripting> <collisions> <physics>",
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index b80d17d..d2d2607 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -36,7 +36,6 @@ using Nini.Config;
36using OpenMetaverse; 36using OpenMetaverse;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Communications; 38using OpenSim.Framework.Communications;
39
40using OpenSim.Framework.Console; 39using OpenSim.Framework.Console;
41using OpenSim.Framework.Servers; 40using OpenSim.Framework.Servers;
42using OpenSim.Framework.Servers.HttpServer; 41using OpenSim.Framework.Servers.HttpServer;
@@ -356,7 +355,9 @@ namespace OpenSim
356 } 355 }
357 catch (Exception e) 356 catch (Exception e)
358 { 357 {
359 m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace); 358 m_log.ErrorFormat(
359 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
360 e.Message, e.StackTrace);
360 361
361 // Carrying on now causes a lot of confusion down the 362 // Carrying on now causes a lot of confusion down the
362 // line - we need to get the user's attention 363 // line - we need to get the user's attention
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 092c96e..3d4269f 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -37,6 +37,7 @@ using System.Xml;
37using log4net; 37using log4net;
38using OpenMetaverse; 38using OpenMetaverse;
39using OpenMetaverse.Packets; 39using OpenMetaverse.Packets;
40using OpenMetaverse.Messages.Linden;
40using OpenMetaverse.StructuredData; 41using OpenMetaverse.StructuredData;
41using OpenSim.Framework; 42using OpenSim.Framework;
42using OpenSim.Framework.Client; 43using OpenSim.Framework.Client;
@@ -59,7 +60,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
59 public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector 60 public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector
60 { 61 {
61 /// <value> 62 /// <value>
62 /// Debug packet level. At the moment, only 255 does anything (prints out all in and out packets). 63 /// Debug packet level. See OpenSim.RegisterConsoleCommands() for more details.
63 /// </value> 64 /// </value>
64 protected int m_debugPacketLevel = 0; 65 protected int m_debugPacketLevel = 0;
65 66
@@ -3407,6 +3408,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3407 3408
3408 avp.Sender.IsTrial = false; 3409 avp.Sender.IsTrial = false;
3409 avp.Sender.ID = agentID; 3410 avp.Sender.ID = agentID;
3411 m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString());
3410 OutPacket(avp, ThrottleOutPacketType.Task); 3412 OutPacket(avp, ThrottleOutPacketType.Task);
3411 } 3413 }
3412 3414
@@ -4199,94 +4201,101 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4199 4201
4200 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) 4202 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
4201 { 4203 {
4202 ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ParcelProperties); 4204 ParcelPropertiesMessage updateMessage = new ParcelPropertiesMessage();
4203 // TODO: don't create new blocks if recycling an old packet
4204 4205
4205 updatePacket.ParcelData.AABBMax = landData.AABBMax; 4206 updateMessage.AABBMax = landData.AABBMax;
4206 updatePacket.ParcelData.AABBMin = landData.AABBMin; 4207 updateMessage.AABBMin = landData.AABBMin;
4207 updatePacket.ParcelData.Area = landData.Area; 4208 updateMessage.Area = landData.Area;
4208 updatePacket.ParcelData.AuctionID = landData.AuctionID; 4209 updateMessage.AuctionID = landData.AuctionID;
4209 updatePacket.ParcelData.AuthBuyerID = landData.AuthBuyerID; 4210 updateMessage.AuthBuyerID = landData.AuthBuyerID;
4210 4211
4211 updatePacket.ParcelData.Bitmap = landData.Bitmap; 4212 updateMessage.Bitmap = landData.Bitmap;
4212 4213
4213 updatePacket.ParcelData.Desc = Utils.StringToBytes(landData.Description); 4214 updateMessage.Desc = landData.Description;
4214 updatePacket.ParcelData.Category = (byte)landData.Category; 4215 updateMessage.Category = landData.Category;
4215 updatePacket.ParcelData.ClaimDate = landData.ClaimDate; 4216 updateMessage.ClaimDate = Util.ToDateTime(landData.ClaimDate);
4216 updatePacket.ParcelData.ClaimPrice = landData.ClaimPrice; 4217 updateMessage.ClaimPrice = landData.ClaimPrice;
4217 updatePacket.ParcelData.GroupID = landData.GroupID; 4218 updateMessage.GroupID = landData.GroupID;
4218 updatePacket.ParcelData.GroupPrims = landData.GroupPrims; 4219 updateMessage.GroupPrims = landData.GroupPrims;
4219 updatePacket.ParcelData.IsGroupOwned = landData.IsGroupOwned; 4220 updateMessage.IsGroupOwned = landData.IsGroupOwned;
4220 updatePacket.ParcelData.LandingType = landData.LandingType; 4221 updateMessage.LandingType = (LandingType) landData.LandingType;
4221 updatePacket.ParcelData.LocalID = landData.LocalID; 4222 updateMessage.LocalID = landData.LocalID;
4222 4223
4223 if (landData.Area > 0) 4224 if (landData.Area > 0)
4224 { 4225 {
4225 updatePacket.ParcelData.MaxPrims = parcelObjectCapacity; 4226 updateMessage.MaxPrims = parcelObjectCapacity;
4226 } 4227 }
4227 else 4228 else
4228 { 4229 {
4229 updatePacket.ParcelData.MaxPrims = 0; 4230 updateMessage.MaxPrims = 0;
4230 } 4231 }
4231 4232
4232 updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale; 4233 updateMessage.MediaAutoScale = Convert.ToBoolean(landData.MediaAutoScale);
4233 updatePacket.ParcelData.MediaID = landData.MediaID; 4234 updateMessage.MediaID = landData.MediaID;
4234 updatePacket.ParcelData.MediaURL = Util.StringToBytes256(landData.MediaURL); 4235 updateMessage.MediaURL = landData.MediaURL;
4235 updatePacket.ParcelData.MusicURL = Util.StringToBytes256(landData.MusicURL); 4236 updateMessage.MusicURL = landData.MusicURL;
4236 updatePacket.ParcelData.Name = Util.StringToBytes256(landData.Name); 4237 updateMessage.Name = landData.Name;
4237 updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime; 4238 updateMessage.OtherCleanTime = landData.OtherCleanTime;
4238 updatePacket.ParcelData.OtherCount = 0; //TODO: Unimplemented 4239 updateMessage.OtherCount = 0; //TODO: Unimplemented
4239 updatePacket.ParcelData.OtherPrims = landData.OtherPrims; 4240 updateMessage.OtherPrims = landData.OtherPrims;
4240 updatePacket.ParcelData.OwnerID = landData.OwnerID; 4241 updateMessage.OwnerID = landData.OwnerID;
4241 updatePacket.ParcelData.OwnerPrims = landData.OwnerPrims; 4242 updateMessage.OwnerPrims = landData.OwnerPrims;
4242 updatePacket.ParcelData.ParcelFlags = landData.Flags; 4243 updateMessage.ParcelFlags = (ParcelFlags) landData.Flags;
4243 updatePacket.ParcelData.ParcelPrimBonus = simObjectBonusFactor; 4244 updateMessage.ParcelPrimBonus = simObjectBonusFactor;
4244 updatePacket.ParcelData.PassHours = landData.PassHours; 4245 updateMessage.PassHours = landData.PassHours;
4245 updatePacket.ParcelData.PassPrice = landData.PassPrice; 4246 updateMessage.PassPrice = landData.PassPrice;
4246 updatePacket.ParcelData.PublicCount = 0; //TODO: Unimplemented 4247 updateMessage.PublicCount = 0; //TODO: Unimplemented
4247 4248
4248 updatePacket.ParcelData.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0; 4249 updateMessage.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0;
4249 updatePacket.ParcelData.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0; 4250 updateMessage.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0;
4250 updatePacket.ParcelData.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0; 4251
4251 updatePacket.ParcelData.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0; 4252 //updateMessage.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0;
4252 4253 //updateMessage.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0;
4253 updatePacket.ParcelData.RentPrice = 0; 4254
4254 updatePacket.ParcelData.RequestResult = request_result; 4255 updateMessage.RentPrice = 0;
4255 updatePacket.ParcelData.SalePrice = landData.SalePrice; 4256 updateMessage.RequestResult = (ParcelResult) request_result;
4256 updatePacket.ParcelData.SelectedPrims = landData.SelectedPrims; 4257 updateMessage.SalePrice = landData.SalePrice;
4257 updatePacket.ParcelData.SelfCount = 0; //TODO: Unimplemented 4258 updateMessage.SelectedPrims = landData.SelectedPrims;
4258 updatePacket.ParcelData.SequenceID = sequence_id; 4259 updateMessage.SelfCount = 0; //TODO: Unimplemented
4260 updateMessage.SequenceID = sequence_id;
4259 if (landData.SimwideArea > 0) 4261 if (landData.SimwideArea > 0)
4260 { 4262 {
4261 updatePacket.ParcelData.SimWideMaxPrims = parcelObjectCapacity; 4263 updateMessage.SimWideMaxPrims = parcelObjectCapacity;
4262 } 4264 }
4263 else 4265 else
4264 { 4266 {
4265 updatePacket.ParcelData.SimWideMaxPrims = 0; 4267 updateMessage.SimWideMaxPrims = 0;
4266 } 4268 }
4267 updatePacket.ParcelData.SimWideTotalPrims = landData.SimwidePrims; 4269 updateMessage.SimWideTotalPrims = landData.SimwidePrims;
4268 updatePacket.ParcelData.SnapSelection = snap_selection; 4270 updateMessage.SnapSelection = snap_selection;
4269 updatePacket.ParcelData.SnapshotID = landData.SnapshotID; 4271 updateMessage.SnapshotID = landData.SnapshotID;
4270 updatePacket.ParcelData.Status = (byte)landData.Status; 4272 updateMessage.Status = (ParcelStatus) landData.Status;
4271 updatePacket.ParcelData.TotalPrims = landData.OwnerPrims + landData.GroupPrims + landData.OtherPrims + 4273 updateMessage.TotalPrims = landData.OwnerPrims + landData.GroupPrims + landData.OtherPrims +
4272 landData.SelectedPrims; 4274 landData.SelectedPrims;
4273 updatePacket.ParcelData.UserLocation = landData.UserLocation; 4275 updateMessage.UserLocation = landData.UserLocation;
4274 updatePacket.ParcelData.UserLookAt = landData.UserLookAt; 4276 updateMessage.UserLookAt = landData.UserLookAt;
4275 updatePacket.Header.Zerocoded = true; 4277
4278 updateMessage.MediaType = landData.MediaType;
4279 updateMessage.MediaDesc = landData.MediaDescription;
4280 updateMessage.MediaWidth = landData.MediaWidth;
4281 updateMessage.MediaHeight = landData.MediaHeight;
4282 updateMessage.MediaLoop = landData.MediaLoop;
4283 updateMessage.ObscureMusic = landData.ObscureMusic;
4284 updateMessage.ObscureMedia = landData.ObscureMedia;
4276 4285
4277 try 4286 try
4278 { 4287 {
4279 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); 4288 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
4280 if (eq != null) 4289 if (eq != null)
4281 { 4290 {
4282 eq.ParcelProperties(updatePacket, this.AgentId); 4291 eq.ParcelProperties(updateMessage, this.AgentId);
4283 } 4292 } else {
4293 m_log.Warn("No EQ Interface when sending parcel data.");
4294 }
4284 } 4295 }
4285 catch (Exception ex) 4296 catch (Exception ex)
4286 { 4297 {
4287 m_log.Error("Unable to send parcel data via eventqueue - exception: " + ex.ToString()); 4298 m_log.Error("Unable to send parcel data via eventqueue - exception: " + ex.ToString());
4288 m_log.Warn("sending parcel data via UDP");
4289 OutPacket(updatePacket, ThrottleOutPacketType.Task);
4290 } 4299 }
4291 } 4300 }
4292 4301
@@ -11166,8 +11175,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11166 /// handles splitting manually</param> 11175 /// handles splitting manually</param>
11167 protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting) 11176 protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting)
11168 { 11177 {
11169 if (m_debugPacketLevel >= 255) 11178 if (m_debugPacketLevel > 0)
11170 m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); 11179 {
11180 bool outputPacket = true;
11181
11182 if (m_debugPacketLevel <= 255
11183 && (packet.Type == PacketType.SimStats || packet.Type == PacketType.SimulatorViewerTimeMessage))
11184 outputPacket = false;
11185
11186 if (m_debugPacketLevel <= 200
11187 &&
11188 (packet.Type == PacketType.ImagePacket
11189 || packet.Type == PacketType.ImageData
11190 || packet.Type == PacketType.LayerData
11191 || packet.Type == PacketType.CoarseLocationUpdate))
11192 outputPacket = false;
11193
11194 if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.AvatarAnimation || packet.Type == PacketType.ViewerEffect))
11195 outputPacket = false;
11196
11197 if (outputPacket)
11198 m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type);
11199 }
11171 11200
11172 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); 11201 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting);
11173 } 11202 }
@@ -11238,15 +11267,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11238 /// Entryway from the client to the simulator. All UDP packets from the client will end up here 11267 /// Entryway from the client to the simulator. All UDP packets from the client will end up here
11239 /// </summary> 11268 /// </summary>
11240 /// <param name="Pack">OpenMetaverse.packet</param> 11269 /// <param name="Pack">OpenMetaverse.packet</param>
11241 public void ProcessInPacket(Packet Pack) 11270 public void ProcessInPacket(Packet packet)
11242 { 11271 {
11243 if (m_debugPacketLevel >= 255) 11272 if (m_debugPacketLevel > 0)
11244 m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type); 11273 {
11274 bool outputPacket = true;
11275
11276 if (m_debugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate)
11277 outputPacket = false;
11278
11279 if (m_debugPacketLevel <= 200 && packet.Type == PacketType.RequestImage)
11280 outputPacket = false;
11281
11282 if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
11283 outputPacket = false;
11284
11285 if (outputPacket)
11286 m_log.DebugFormat("[CLIENT]: Packet IN {0}", packet.Type);
11287 }
11245 11288
11246 if (!ProcessPacketMethod(Pack)) 11289 if (!ProcessPacketMethod(packet))
11247 m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type); 11290 m_log.Warn("[CLIENT]: unhandled packet " + packet.Type);
11248 11291
11249 PacketPool.Instance.ReturnPacket(Pack); 11292 PacketPool.Instance.ReturnPacket(packet);
11250 } 11293 }
11251 11294
11252 private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) 11295 private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index d56145a..6555b54 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -173,16 +173,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
173 UUID itemID = UUID.Zero; 173 UUID itemID = UUID.Zero;
174 if (sp != null) 174 if (sp != null)
175 { 175 {
176 foreach(SceneObjectGroup grp in sp.Attachments) 176 foreach(SceneObjectGroup grp in sp.GetAttachments(AttachmentPt))
177 { 177 {
178 if (grp.GetAttachmentPoint() == (byte)AttachmentPt) 178 itemID = grp.GetFromItemID();
179 { 179 if (itemID != UUID.Zero)
180 itemID = grp.GetFromItemID(); 180 DetachSingleAttachmentToInv(itemID, remoteClient);
181 break; 181 }
182 }
183 }
184 if (itemID != UUID.Zero)
185 DetachSingleAttachmentToInv(itemID, remoteClient);
186 } 182 }
187 183
188 if (group.GetFromItemID() == UUID.Zero) 184 if (group.GetFromItemID() == UUID.Zero)
@@ -196,12 +192,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
196 192
197 SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group); 193 SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group);
198 194
199 group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); 195 AttachToAgent(sp, group, AttachmentPt, attachPos, silent);
200
201 // In case it is later dropped again, don't let
202 // it get cleaned up
203 group.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
204 group.HasGroupChanged = false;
205 } 196 }
206 else 197 else
207 { 198 {
@@ -529,6 +520,78 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
529 remoteClient.SendInventoryItemCreateUpdate(item, 0); 520 remoteClient.SendInventoryItemCreateUpdate(item, 0);
530 } 521 }
531 } 522 }
532 } 523 }
524
525 /// <summary>
526 /// Attach this scene object to the given avatar.
527 /// </summary>
528 ///
529 /// This isn't publicly available since attachments should always perform the corresponding inventory
530 /// operation (to show the attach in user inventory and update the asset with positional information).
531 ///
532 /// <param name="sp"></param>
533 /// <param name="so"></param>
534 /// <param name="attachmentpoint"></param>
535 /// <param name="AttachOffset"></param>
536 /// <param name="silent"></param>
537 protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 AttachOffset, bool silent)
538 {
539 // don't attach attachments to child agents
540 if (avatar.IsChildAgent) return;
541
542// m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
543
544 so.DetachFromBackup();
545
546 // Remove from database and parcel prim count
547 m_scene.DeleteFromStorage(so.UUID);
548 m_scene.EventManager.TriggerParcelPrimCountTainted();
549
550 so.RootPart.AttachedAvatar = avatar.UUID;
551
552 //Anakin Lohner bug #3839
553 lock (so.Children)
554 {
555 foreach (SceneObjectPart p in so.Children.Values)
556 {
557 p.AttachedAvatar = avatar.UUID;
558 }
559 }
560
561 if (so.RootPart.PhysActor != null)
562 {
563 m_scene.PhysicsScene.RemovePrim(so.RootPart.PhysActor);
564 so.RootPart.PhysActor = null;
565 }
566
567 so.AbsolutePosition = AttachOffset;
568 so.RootPart.AttachedPos = AttachOffset;
569 so.RootPart.IsAttachment = true;
570
571 so.RootPart.SetParentLocalId(avatar.LocalId);
572 so.SetAttachmentPoint(Convert.ToByte(attachmentpoint));
573
574 avatar.AddAttachment(so);
575
576 if (!silent)
577 {
578 // Killing it here will cause the client to deselect it
579 // It then reappears on the avatar, deselected
580 // through the full update below
581 //
582 if (so.IsSelected)
583 {
584 m_scene.SendKillObject(so.RootPart.LocalId);
585 }
586
587 so.IsSelected = false; // fudge....
588 so.ScheduleGroupForFullUpdate();
589 }
590
591 // In case it is later dropped again, don't let
592 // it get cleaned up
593 so.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
594 so.HasGroupChanged = false;
595 }
533 } 596 }
534} \ No newline at end of file 597} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs
index 0c6cb1b..35b70de 100644
--- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs
@@ -34,6 +34,7 @@ using System.Threading;
34using log4net; 34using log4net;
35using Nini.Config; 35using Nini.Config;
36using OpenMetaverse; 36using OpenMetaverse;
37using OpenMetaverse.Messages.Linden;
37using OpenMetaverse.Packets; 38using OpenMetaverse.Packets;
38using OpenMetaverse.StructuredData; 39using OpenMetaverse.StructuredData;
39using OpenSim.Framework; 40using OpenSim.Framework;
@@ -137,10 +138,11 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
137 { 138 {
138 if (!queues.ContainsKey(agentId)) 139 if (!queues.ContainsKey(agentId))
139 { 140 {
141 /*
140 m_log.DebugFormat( 142 m_log.DebugFormat(
141 "[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", 143 "[EVENTQUEUE]: Adding new queue for agent {0} in region {1}",
142 agentId, m_scene.RegionInfo.RegionName); 144 agentId, m_scene.RegionInfo.RegionName);
143 145 */
144 queues[agentId] = new Queue<OSD>(); 146 queues[agentId] = new Queue<OSD>();
145 } 147 }
146 148
@@ -200,7 +202,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
200 202
201 private void ClientClosed(UUID AgentID, Scene scene) 203 private void ClientClosed(UUID AgentID, Scene scene)
202 { 204 {
203 m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName); 205 //m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName);
204 206
205 int count = 0; 207 int count = 0;
206 while (queues.ContainsKey(AgentID) && queues[AgentID].Count > 0 && count++ < 5) 208 while (queues.ContainsKey(AgentID) && queues[AgentID].Count > 0 && count++ < 5)
@@ -284,7 +286,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
284 // Reuse open queues. The client does! 286 // Reuse open queues. The client does!
285 if (m_AvatarQueueUUIDMapping.ContainsKey(agentID)) 287 if (m_AvatarQueueUUIDMapping.ContainsKey(agentID))
286 { 288 {
287 m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!"); 289 //m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!");
288 EventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID]; 290 EventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID];
289 } 291 }
290 else 292 else
@@ -365,7 +367,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
365 { 367 {
366 // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! 368 // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say!
367 array.Add(EventQueueHelper.KeepAliveEvent()); 369 array.Add(EventQueueHelper.KeepAliveEvent());
368 m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", pAgentId, m_scene.RegionInfo.RegionName); 370 //m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", pAgentId, m_scene.RegionInfo.RegionName);
369 } 371 }
370 else 372 else
371 { 373 {
@@ -394,8 +396,8 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
394 responsedata["keepalive"] = false; 396 responsedata["keepalive"] = false;
395 responsedata["reusecontext"] = false; 397 responsedata["reusecontext"] = false;
396 responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); 398 responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events);
399 //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", pAgentId, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);
397 return responsedata; 400 return responsedata;
398 //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);
399 } 401 }
400 402
401 public Hashtable NoEvents(UUID requestID, UUID agentID) 403 public Hashtable NoEvents(UUID requestID, UUID agentID)
@@ -461,7 +463,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
461 { 463 {
462 // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! 464 // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say!
463 array.Add(EventQueueHelper.KeepAliveEvent()); 465 array.Add(EventQueueHelper.KeepAliveEvent());
464 m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); 466 //m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName);
465 } 467 }
466 else 468 else
467 { 469 {
@@ -697,9 +699,9 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
697 //m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item); 699 //m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item);
698 } 700 }
699 701
700 public void ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket, UUID avatarID) 702 public void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID)
701 { 703 {
702 OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesPacket); 704 OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesMessage);
703 Enqueue(item, avatarID); 705 Enqueue(item, avatarID);
704 } 706 }
705 707
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
index e9bcae3..6294935 100644
--- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
+++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
@@ -30,6 +30,7 @@ using System.Net;
30using OpenMetaverse; 30using OpenMetaverse;
31using OpenMetaverse.Packets; 31using OpenMetaverse.Packets;
32using OpenMetaverse.StructuredData; 32using OpenMetaverse.StructuredData;
33using OpenMetaverse.Messages.Linden;
33 34
34namespace OpenSim.Region.CoreModules.Framework.EventQueue 35namespace OpenSim.Region.CoreModules.Framework.EventQueue
35{ 36{
@@ -309,116 +310,6 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
309 return chatterBoxSessionAgentListUpdates; 310 return chatterBoxSessionAgentListUpdates;
310 } 311 }
311 312
312 public static OSD ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket)
313 {
314 OSDMap parcelProperties = new OSDMap();
315 OSDMap body = new OSDMap();
316
317 OSDArray ageVerificationBlock = new OSDArray();
318 OSDMap ageVerificationMap = new OSDMap();
319 ageVerificationMap.Add("RegionDenyAgeUnverified",
320 OSD.FromBoolean(parcelPropertiesPacket.AgeVerificationBlock.RegionDenyAgeUnverified));
321 ageVerificationBlock.Add(ageVerificationMap);
322 body.Add("AgeVerificationBlock", ageVerificationBlock);
323
324 // LL sims send media info in this event queue message but it's not in the UDP
325 // packet we construct this event queue message from. This should be refactored in
326 // other areas of the code so it can all be send in the same message. Until then we will
327 // still send the media info via UDP
328
329 //OSDArray mediaData = new OSDArray();
330 //OSDMap mediaDataMap = new OSDMap();
331 //mediaDataMap.Add("MediaDesc", OSD.FromString(""));
332 //mediaDataMap.Add("MediaHeight", OSD.FromInteger(0));
333 //mediaDataMap.Add("MediaLoop", OSD.FromInteger(0));
334 //mediaDataMap.Add("MediaType", OSD.FromString("type/type"));
335 //mediaDataMap.Add("MediaWidth", OSD.FromInteger(0));
336 //mediaDataMap.Add("ObscureMedia", OSD.FromInteger(0));
337 //mediaDataMap.Add("ObscureMusic", OSD.FromInteger(0));
338 //mediaData.Add(mediaDataMap);
339 //body.Add("MediaData", mediaData);
340
341 OSDArray parcelData = new OSDArray();
342 OSDMap parcelDataMap = new OSDMap();
343 OSDArray AABBMax = new OSDArray(3);
344 AABBMax.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMax.X));
345 AABBMax.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMax.Y));
346 AABBMax.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMax.Z));
347 parcelDataMap.Add("AABBMax", AABBMax);
348
349 OSDArray AABBMin = new OSDArray(3);
350 AABBMin.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMin.X));
351 AABBMin.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMin.Y));
352 AABBMin.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMin.Z));
353 parcelDataMap.Add("AABBMin", AABBMin);
354
355 parcelDataMap.Add("Area", OSD.FromInteger(parcelPropertiesPacket.ParcelData.Area));
356 parcelDataMap.Add("AuctionID", OSD.FromBinary(uintToByteArray(parcelPropertiesPacket.ParcelData.AuctionID)));
357 parcelDataMap.Add("AuthBuyerID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.AuthBuyerID));
358 parcelDataMap.Add("Bitmap", OSD.FromBinary(parcelPropertiesPacket.ParcelData.Bitmap));
359 parcelDataMap.Add("Category", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.Category));
360 parcelDataMap.Add("ClaimDate", OSD.FromInteger(parcelPropertiesPacket.ParcelData.ClaimDate));
361 parcelDataMap.Add("ClaimPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.ClaimPrice));
362 parcelDataMap.Add("Desc", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.Desc)));
363 parcelDataMap.Add("GroupID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.GroupID));
364 parcelDataMap.Add("GroupPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.GroupPrims));
365 parcelDataMap.Add("IsGroupOwned", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.IsGroupOwned));
366 parcelDataMap.Add("LandingType", OSD.FromInteger(parcelPropertiesPacket.ParcelData.LandingType));
367 parcelDataMap.Add("LocalID", OSD.FromInteger(parcelPropertiesPacket.ParcelData.LocalID));
368 parcelDataMap.Add("MaxPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.MaxPrims));
369 parcelDataMap.Add("MediaAutoScale", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.MediaAutoScale));
370 parcelDataMap.Add("MediaID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.MediaID));
371 parcelDataMap.Add("MediaURL", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.MediaURL)));
372 parcelDataMap.Add("MusicURL", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.MusicURL)));
373 parcelDataMap.Add("Name", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.Name)));
374 parcelDataMap.Add("OtherCleanTime", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherCleanTime));
375 parcelDataMap.Add("OtherCount", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherCount));
376 parcelDataMap.Add("OtherPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherPrims));
377 parcelDataMap.Add("OwnerID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.OwnerID));
378 parcelDataMap.Add("OwnerPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OwnerPrims));
379 parcelDataMap.Add("ParcelFlags", OSD.FromBinary(uintToByteArray(parcelPropertiesPacket.ParcelData.ParcelFlags)));
380 parcelDataMap.Add("ParcelPrimBonus", OSD.FromReal(parcelPropertiesPacket.ParcelData.ParcelPrimBonus));
381 parcelDataMap.Add("PassHours", OSD.FromReal(parcelPropertiesPacket.ParcelData.PassHours));
382 parcelDataMap.Add("PassPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.PassPrice));
383 parcelDataMap.Add("PublicCount", OSD.FromInteger(parcelPropertiesPacket.ParcelData.PublicCount));
384 parcelDataMap.Add("RegionDenyAnonymous", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionDenyAnonymous));
385 parcelDataMap.Add("RegionDenyIdentified", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionDenyIdentified));
386 parcelDataMap.Add("RegionDenyTransacted", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionDenyTransacted));
387
388 parcelDataMap.Add("RegionPushOverride", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionPushOverride));
389 parcelDataMap.Add("RentPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.RentPrice));
390 parcelDataMap.Add("RequestResult", OSD.FromInteger(parcelPropertiesPacket.ParcelData.RequestResult));
391 parcelDataMap.Add("SalePrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SalePrice));
392 parcelDataMap.Add("SelectedPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SelectedPrims));
393 parcelDataMap.Add("SelfCount", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SelfCount));
394 parcelDataMap.Add("SequenceID", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SequenceID));
395 parcelDataMap.Add("SimWideMaxPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SimWideMaxPrims));
396 parcelDataMap.Add("SimWideTotalPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SimWideTotalPrims));
397 parcelDataMap.Add("SnapSelection", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.SnapSelection));
398 parcelDataMap.Add("SnapshotID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.SnapshotID));
399 parcelDataMap.Add("Status", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.Status));
400 parcelDataMap.Add("TotalPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.TotalPrims));
401
402 OSDArray UserLocation = new OSDArray(3);
403 UserLocation.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLocation.X));
404 UserLocation.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLocation.Y));
405 UserLocation.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLocation.Z));
406 parcelDataMap.Add("UserLocation", UserLocation);
407
408 OSDArray UserLookAt = new OSDArray(3);
409 UserLookAt.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLookAt.X));
410 UserLookAt.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLookAt.Y));
411 UserLookAt.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLookAt.Z));
412 parcelDataMap.Add("UserLookAt", UserLookAt);
413
414 parcelData.Add(parcelDataMap);
415 body.Add("ParcelData", parcelData);
416 parcelProperties.Add("body", body);
417 parcelProperties.Add("message", OSD.FromString("ParcelProperties"));
418
419 return parcelProperties;
420 }
421
422 public static OSD GroupMembership(AgentGroupDataUpdatePacket groupUpdatePacket) 313 public static OSD GroupMembership(AgentGroupDataUpdatePacket groupUpdatePacket)
423 { 314 {
424 OSDMap groupUpdate = new OSDMap(); 315 OSDMap groupUpdate = new OSDMap();
@@ -495,5 +386,14 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
495 return placesReply; 386 return placesReply;
496 } 387 }
497 388
389 public static OSD ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage)
390 {
391 OSDMap message = new OSDMap();
392 message.Add("message", OSD.FromString("ParcelProperties"));
393 OSD message_body = parcelPropertiesMessage.Serialize();
394 message.Add("body", message_body);
395 return message;
396 }
397
498 } 398 }
499} 399}
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 6decf54..2ac2324 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -641,7 +641,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
641 } 641 }
642 642
643 // Fire on_rez 643 // Fire on_rez
644 group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 0); 644 group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1);
645 rootPart.ParentGroup.ResumeScripts(); 645 rootPart.ParentGroup.ResumeScripts();
646 646
647 rootPart.ScheduleFullUpdate(); 647 rootPart.ScheduleFullUpdate();
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 15dc301..3e79ec0 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -33,6 +33,8 @@ using System.Reflection;
33using log4net; 33using log4net;
34using Nini.Config; 34using Nini.Config;
35using OpenMetaverse; 35using OpenMetaverse;
36using OpenMetaverse.StructuredData;
37using OpenMetaverse.Messages.Linden;
36using OpenSim.Framework; 38using OpenSim.Framework;
37using OpenSim.Framework.Capabilities; 39using OpenSim.Framework.Capabilities;
38using OpenSim.Framework.Servers; 40using OpenSim.Framework.Servers;
@@ -1066,7 +1068,6 @@ namespace OpenSim.Region.CoreModules.World.Land
1066 { 1068 {
1067 for (int y = 0; y < inc_y; y++) 1069 for (int y = 0; y < inc_y; y++)
1068 { 1070 {
1069
1070 ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); 1071 ILandObject currentParcel = GetLandObject(start_x + x, start_y + y);
1071 1072
1072 if (currentParcel != null) 1073 if (currentParcel != null)
@@ -1353,8 +1354,68 @@ namespace OpenSim.Region.CoreModules.World.Land
1353 { 1354 {
1354 return RemoteParcelRequest(request, path, param, agentID, caps); 1355 return RemoteParcelRequest(request, path, param, agentID, caps);
1355 })); 1356 }));
1356 } 1357 UUID parcelCapID = UUID.Random();
1358 caps.RegisterHandler("ParcelPropertiesUpdate",
1359 new RestStreamHandler("POST", "/CAPS/" + parcelCapID,
1360 delegate(string request, string path, string param,
1361 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
1362 {
1363 return ProcessPropertiesUpdate(request, path, param, agentID, caps);
1364 }));
1365 }
1366 private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps)
1367 {
1368 IClientAPI client;
1369 if ( ! m_scene.TryGetClient(agentID, out client) ) {
1370 m_log.WarnFormat("[LAND] unable to retrieve IClientAPI for {0}", agentID.ToString() );
1371 return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty());
1372 }
1373
1374 ParcelPropertiesUpdateMessage properties = new ParcelPropertiesUpdateMessage();
1375 OpenMetaverse.StructuredData.OSDMap args = (OpenMetaverse.StructuredData.OSDMap) OSDParser.DeserializeLLSDXml(request);
1376
1377 properties.Deserialize(args);
1378
1379 LandUpdateArgs land_update = new LandUpdateArgs();
1380 int parcelID = properties.LocalID;
1381 land_update.AuthBuyerID = properties.AuthBuyerID;
1382 land_update.Category = properties.Category;
1383 land_update.Desc = properties.Desc;
1384 land_update.GroupID = properties.GroupID;
1385 land_update.LandingType = (byte) properties.Landing;
1386 land_update.MediaAutoScale = (byte) Convert.ToInt32(properties.MediaAutoScale);
1387 land_update.MediaID = properties.MediaID;
1388 land_update.MediaURL = properties.MediaURL;
1389 land_update.MusicURL = properties.MusicURL;
1390 land_update.Name = properties.Name;
1391 land_update.ParcelFlags = (uint) properties.ParcelFlags;
1392 land_update.PassHours = (int) properties.PassHours;
1393 land_update.PassPrice = (int) properties.PassPrice;
1394 land_update.SalePrice = (int) properties.SalePrice;
1395 land_update.SnapshotID = properties.SnapshotID;
1396 land_update.UserLocation = properties.UserLocation;
1397 land_update.UserLookAt = properties.UserLookAt;
1398 land_update.MediaDescription = properties.MediaDesc;
1399 land_update.MediaType = properties.MediaType;
1400 land_update.MediaWidth = properties.MediaWidth;
1401 land_update.MediaHeight = properties.MediaHeight;
1402 land_update.MediaLoop = properties.MediaLoop;
1403 land_update.ObscureMusic = properties.ObscureMusic;
1404 land_update.ObscureMedia = properties.ObscureMedia;
1405
1406 ILandObject land;
1407 lock (m_landList)
1408 {
1409 m_landList.TryGetValue(parcelID, out land);
1410 }
1357 1411
1412 if (land != null) {
1413 land.UpdateLandProperties(land_update, client);
1414 } else {
1415 m_log.WarnFormat("[LAND] unable to find parcelID {0}", parcelID);
1416 }
1417 return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty());
1418 }
1358 // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the 1419 // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the
1359 // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. 1420 // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to.
1360 // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x 1421 // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 6864629..499b60c 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -229,6 +229,13 @@ namespace OpenSim.Region.CoreModules.World.Land
229 newData.SnapshotID = args.SnapshotID; 229 newData.SnapshotID = args.SnapshotID;
230 newData.UserLocation = args.UserLocation; 230 newData.UserLocation = args.UserLocation;
231 newData.UserLookAt = args.UserLookAt; 231 newData.UserLookAt = args.UserLookAt;
232 newData.MediaType = args.MediaType;
233 newData.MediaDescription = args.MediaDescription;
234 newData.MediaWidth = args.MediaWidth;
235 newData.MediaHeight = args.MediaHeight;
236 newData.MediaLoop = args.MediaLoop;
237 newData.ObscureMusic = args.ObscureMusic;
238 newData.ObscureMedia = args.ObscureMedia;
232 239
233 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); 240 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
234 241
diff --git a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs
index e093f0a..81e4952 100644
--- a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs
@@ -28,6 +28,7 @@
28using System.Net; 28using System.Net;
29using OpenMetaverse; 29using OpenMetaverse;
30using OpenMetaverse.Packets; 30using OpenMetaverse.Packets;
31using OpenMetaverse.Messages.Linden;
31using OpenMetaverse.StructuredData; 32using OpenMetaverse.StructuredData;
32 33
33namespace OpenSim.Region.Framework.Interfaces 34namespace OpenSim.Region.Framework.Interfaces
@@ -54,7 +55,7 @@ namespace OpenSim.Region.Framework.Interfaces
54 uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket); 55 uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket);
55 void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, 56 void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat,
56 bool isModerator, bool textMute); 57 bool isModerator, bool textMute);
57 void ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket, UUID avatarID); 58 void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID);
58 void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); 59 void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID);
59 } 60 }
60} 61}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 2ac46e2..0674e62 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1940,7 +1940,7 @@ namespace OpenSim.Region.Framework.Scenes
1940 1940
1941 // We can only call this after adding the scene object, since the scene object references the scene 1941 // We can only call this after adding the scene object, since the scene object references the scene
1942 // to find out if scripts should be activated at all. 1942 // to find out if scripts should be activated at all.
1943 group.CreateScriptInstances(param, true, DefaultScriptEngine, 2); 1943 group.CreateScriptInstances(param, true, DefaultScriptEngine, 3);
1944 1944
1945 group.ScheduleGroupForFullUpdate(); 1945 group.ScheduleGroupForFullUpdate();
1946 1946
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index db081cc..56ac2c2 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2376,7 +2376,7 @@ namespace OpenSim.Region.Framework.Scenes
2376 return false; 2376 return false;
2377 } 2377 }
2378 2378
2379 newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1); 2379 newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 2);
2380 2380
2381 newObject.ResumeScripts(); 2381 newObject.ResumeScripts();
2382 2382
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 2c242c9..e7175c5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1845,7 +1845,7 @@ namespace OpenSim.Region.Framework.Scenes
1845 copy.UpdateGroupRotationR(rot); 1845 copy.UpdateGroupRotationR(rot);
1846 } 1846 }
1847 1847
1848 copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 0); 1848 copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 1);
1849 copy.HasGroupChanged = true; 1849 copy.HasGroupChanged = true;
1850 copy.ScheduleGroupForFullUpdate(); 1850 copy.ScheduleGroupForFullUpdate();
1851 copy.ResumeScripts(); 1851 copy.ResumeScripts();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 40a8f83..64a6dd5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -977,77 +977,6 @@ namespace OpenSim.Region.Framework.Scenes
977 } 977 }
978 } 978 }
979 979
980 /// <summary>
981 /// Attach this scene object to the given avatar.
982 /// </summary>
983 /// <param name="agentID"></param>
984 /// <param name="attachmentpoint"></param>
985 /// <param name="AttachOffset"></param>
986 public void AttachToAgent(UUID agentID, uint attachmentpoint, Vector3 AttachOffset, bool silent)
987 {
988 ScenePresence avatar = m_scene.GetScenePresence(agentID);
989 if (avatar != null)
990 {
991 // don't attach attachments to child agents
992 if (avatar.IsChildAgent) return;
993
994// m_log.DebugFormat("[SOG]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
995
996 DetachFromBackup();
997
998 // Remove from database and parcel prim count
999 m_scene.DeleteFromStorage(UUID);
1000 m_scene.EventManager.TriggerParcelPrimCountTainted();
1001
1002 m_rootPart.AttachedAvatar = agentID;
1003
1004 //Anakin Lohner bug #3839
1005 lock (m_parts)
1006 {
1007 foreach (SceneObjectPart p in m_parts.Values)
1008 {
1009 p.AttachedAvatar = agentID;
1010 }
1011 }
1012
1013 if (m_rootPart.PhysActor != null)
1014 {
1015 m_scene.PhysicsScene.RemovePrim(m_rootPart.PhysActor);
1016 m_rootPart.PhysActor = null;
1017 }
1018
1019 AbsolutePosition = AttachOffset;
1020 m_rootPart.AttachedPos = AttachOffset;
1021 m_rootPart.IsAttachment = true;
1022
1023 m_rootPart.SetParentLocalId(avatar.LocalId);
1024 SetAttachmentPoint(Convert.ToByte(attachmentpoint));
1025
1026 avatar.AddAttachment(this);
1027
1028 if (!silent)
1029 {
1030 // Killing it here will cause the client to deselect it
1031 // It then reappears on the avatar, deselected
1032 // through the full update below
1033 //
1034 if (IsSelected)
1035 {
1036 m_scene.SendKillObject(m_rootPart.LocalId);
1037 }
1038
1039 IsSelected = false; // fudge....
1040 ScheduleGroupForFullUpdate();
1041 }
1042 }
1043 else
1044 {
1045 m_log.WarnFormat(
1046 "[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present",
1047 UUID, agentID, Scene.RegionInfo.RegionName);
1048 }
1049 }
1050
1051 public byte GetAttachmentPoint() 980 public byte GetAttachmentPoint()
1052 { 981 {
1053 return m_rootPart.Shape.State; 982 return m_rootPart.Shape.State;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index fbb3177..cc9355e 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2464,7 +2464,6 @@ namespace OpenSim.Region.Framework.Scenes
2464 m_controllingClient.SendAvatarDataImmediate(this); 2464 m_controllingClient.SendAvatarDataImmediate(this);
2465 2465
2466 SendInitialFullUpdateToAllClients(); 2466 SendInitialFullUpdateToAllClients();
2467 SendAppearanceToAllOtherAgents();
2468 } 2467 }
2469 2468
2470 /// <summary> 2469 /// <summary>
@@ -3383,6 +3382,27 @@ namespace OpenSim.Region.Framework.Scenes
3383 m_attachments.Add(gobj); 3382 m_attachments.Add(gobj);
3384 } 3383 }
3385 } 3384 }
3385
3386 /// <summary>
3387 /// Get the scene object attached to the given point.
3388 /// </summary>
3389 /// <param name="attachmentPoint"></param>
3390 /// <returns>Returns an empty list if there were no attachments at the point.</returns>
3391 public List<SceneObjectGroup> GetAttachments(uint attachmentPoint)
3392 {
3393 List<SceneObjectGroup> attachments = new List<SceneObjectGroup>();
3394
3395 lock (m_attachments)
3396 {
3397 foreach (SceneObjectGroup so in m_attachments)
3398 {
3399 if (attachmentPoint == so.RootPart.AttachmentPoint)
3400 attachments.Add(so);
3401 }
3402 }
3403
3404 return attachments;
3405 }
3386 3406
3387 public bool HasAttachments() 3407 public bool HasAttachments()
3388 { 3408 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index af42dae..b51b410 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -9137,8 +9137,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9137 // we send to all 9137 // we send to all
9138 landData.MediaID = new UUID(texture); 9138 landData.MediaID = new UUID(texture);
9139 landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0; 9139 landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0;
9140 landData.MediaSize[0] = width; 9140 landData.MediaWidth = width;
9141 landData.MediaSize[1] = height; 9141 landData.MediaHeight = height;
9142 landData.MediaType = mediaType; 9142 landData.MediaType = mediaType;
9143 9143
9144 // do that one last, it will cause a ParcelPropertiesUpdate 9144 // do that one last, it will cause a ParcelPropertiesUpdate
@@ -9224,8 +9224,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9224 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaType)); 9224 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaType));
9225 break; 9225 break;
9226 case ParcelMediaCommandEnum.Size: 9226 case ParcelMediaCommandEnum.Size:
9227 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[0])); 9227 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaWidth));
9228 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[1])); 9228 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaHeight));
9229 break; 9229 break;
9230 default: 9230 default:
9231 ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url; 9231 ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url;
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 84306e7..fb395ec 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -293,13 +293,35 @@ namespace OpenSim.Services.InventoryService
293 293
294 public virtual bool AddFolder(InventoryFolderBase folder) 294 public virtual bool AddFolder(InventoryFolderBase folder)
295 { 295 {
296 InventoryFolderBase check = GetFolder(folder);
297 if (check != null)
298 return false;
299
296 XInventoryFolder xFolder = ConvertFromOpenSim(folder); 300 XInventoryFolder xFolder = ConvertFromOpenSim(folder);
297 return m_Database.StoreFolder(xFolder); 301 return m_Database.StoreFolder(xFolder);
298 } 302 }
299 303
300 public virtual bool UpdateFolder(InventoryFolderBase folder) 304 public virtual bool UpdateFolder(InventoryFolderBase folder)
301 { 305 {
302 return AddFolder(folder); 306 XInventoryFolder xFolder = ConvertFromOpenSim(folder);
307 InventoryFolderBase check = GetFolder(folder);
308 if (check == null)
309 return AddFolder(folder);
310
311 if (check.Type != -1 || xFolder.type != -1)
312 {
313 if (xFolder.version > check.Version)
314 return false;
315 check.Version = (ushort)xFolder.version;
316 xFolder = ConvertFromOpenSim(check);
317 return m_Database.StoreFolder(xFolder);
318 }
319
320 if (xFolder.version < check.Version)
321 xFolder.version = check.Version;
322 xFolder.folderID = check.ID;
323
324 return m_Database.StoreFolder(xFolder);
303 } 325 }
304 326
305 public virtual bool MoveFolder(InventoryFolderBase folder) 327 public virtual bool MoveFolder(InventoryFolderBase folder)