aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs2
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs92
-rw-r--r--OpenSim/Client/MXP/ClientStack/MXPClientView.cs6
-rw-r--r--OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs7
-rw-r--r--OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs7
-rw-r--r--OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs4
-rw-r--r--OpenSim/Data/MySQL/MySQLLegacyRegionData.cs4
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserAccountData.cs2
-rw-r--r--OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs4
-rw-r--r--OpenSim/Data/Tests/RegionTests.cs8
-rw-r--r--OpenSim/Framework/AvatarWearable.cs39
-rw-r--r--OpenSim/Framework/IClientAPI.cs4
-rw-r--r--OpenSim/Region/Application/ConfigurationLoader.cs12
-rw-r--r--OpenSim/Region/Application/OpenSim.cs16
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs62
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs26
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs5
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs15
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs54
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs14
-rw-r--r--OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs12
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs16
-rw-r--r--OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs169
-rw-r--r--OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs35
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs5
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs5
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs12
-rw-r--r--OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs263
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs9
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs18
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs17
-rw-r--r--OpenSim/Region/DataSnapshot/ObjectSnapshot.cs2
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs6
-rw-r--r--OpenSim/Region/Framework/Interfaces/IBuySellModule.cs47
-rw-r--r--OpenSim/Region/Framework/Interfaces/ICloudModule.cs3
-rw-r--r--OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs3
-rw-r--r--OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Prioritizer.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs386
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs3
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs6
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs17
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs2
-rw-r--r--OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs7
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs15
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs2
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs4
-rw-r--r--OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs2
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs11
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs6
-rw-r--r--OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs2
-rw-r--r--OpenSim/Tests/ConfigurationLoaderTest.cs143
-rw-r--r--OpenSim/Tools/Configger/ConfigurationLoader.cs12
66 files changed, 1093 insertions, 600 deletions
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
index 1e85a22..b16f46c 100644
--- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
+++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
@@ -122,7 +122,9 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
122 m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + 122 m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
123 Thread.CurrentThread.ManagedThreadId.ToString() + 123 Thread.CurrentThread.ManagedThreadId.ToString() +
124 ")"); 124 ")");
125 m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
125 m_openSim.CreateRegion(regionsToLoad[i], true, out scene); 126 m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
127 regionsToLoad[i].EstateSettings.Save();
126 if (scene != null) 128 if (scene != null)
127 { 129 {
128 m_newRegionCreatedHandler = OnNewRegionCreated; 130 m_newRegionCreatedHandler = OnNewRegionCreated;
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 026c6ed..826a1b0 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -562,12 +562,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
562 /// <description>desired region X coordinate (integer)</description></item> 562 /// <description>desired region X coordinate (integer)</description></item>
563 /// <item><term>region_y</term> 563 /// <item><term>region_y</term>
564 /// <description>desired region Y coordinate (integer)</description></item> 564 /// <description>desired region Y coordinate (integer)</description></item>
565 /// <item><term>region_master_first</term> 565 /// <item><term>estate_owner_first</term>
566 /// <description>firstname of region master</description></item> 566 /// <description>firstname of estate owner (formerly region master)
567 /// <item><term>region_master_last</term> 567 /// (required if new estate is being created, optional otherwise)</description></item>
568 /// <description>lastname of region master</description></item> 568 /// <item><term>estate_owner_last</term>
569 /// <item><term>region_master_uuid</term> 569 /// <description>lastname of estate owner (formerly region master)
570 /// <description>explicit UUID to use for master avatar (optional)</description></item> 570 /// (required if new estate is being created, optional otherwise)</description></item>
571 /// <item><term>estate_owner_uuid</term>
572 /// <description>explicit UUID to use for estate owner (optional)</description></item>
571 /// <item><term>listen_ip</term> 573 /// <item><term>listen_ip</term>
572 /// <description>internal IP address (dotted quad)</description></item> 574 /// <description>internal IP address (dotted quad)</description></item>
573 /// <item><term>listen_port</term> 575 /// <item><term>listen_port</term>
@@ -583,6 +585,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
583 /// <item><term>enable_voice</term> 585 /// <item><term>enable_voice</term>
584 /// <description>if true, enable voice on all parcels, 586 /// <description>if true, enable voice on all parcels,
585 /// ('true' or 'false') (optional, default: false)</description></item> 587 /// ('true' or 'false') (optional, default: false)</description></item>
588 /// <item><term>estate_name</term>
589 /// <description>the name of the estate to join (or to create if it doesn't
590 /// already exist)</description></item>
586 /// </list> 591 /// </list>
587 /// 592 ///
588 /// XmlRpcCreateRegionMethod returns 593 /// XmlRpcCreateRegionMethod returns
@@ -621,9 +626,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
621 { 626 {
622 "password", 627 "password",
623 "region_name", 628 "region_name",
624 "region_master_first", "region_master_last", 629 "listen_ip", "external_address",
625 "region_master_password", 630 "estate_name"
626 "listen_ip", "external_address"
627 }); 631 });
628 CheckIntegerParams(request, new string[] {"region_x", "region_y", "listen_port"}); 632 CheckIntegerParams(request, new string[] {"region_x", "region_y", "listen_port"});
629 633
@@ -694,18 +698,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
694 698
695 region.ExternalHostName = (string) requestData["external_address"]; 699 region.ExternalHostName = (string) requestData["external_address"];
696 700
697 string masterFirst = (string) requestData["region_master_first"];
698 string masterLast = (string) requestData["region_master_last"];
699 string masterPassword = (string) requestData["region_master_password"];
700
701 UUID userID = UUID.Zero;
702 if (requestData.ContainsKey("region_master_uuid"))
703 {
704 // ok, client wants us to use an explicit UUID
705 // regardless of what the avatar name provided
706 userID = new UUID((string) requestData["estate_owner_uuid"]);
707 }
708
709 bool persist = Convert.ToBoolean((string) requestData["persist"]); 701 bool persist = Convert.ToBoolean((string) requestData["persist"]);
710 if (persist) 702 if (persist)
711 { 703 {
@@ -740,7 +732,55 @@ namespace OpenSim.ApplicationPlugins.RemoteController
740 { 732 {
741 region.Persistent = false; 733 region.Persistent = false;
742 } 734 }
743 735
736 // Set the estate
737
738 // Check for an existing estate
739 List<int> estateIDs = m_application.StorageManager.EstateDataStore.GetEstates((string) requestData["estate_name"]);
740 if (estateIDs.Count < 1)
741 {
742 UUID userID = UUID.Zero;
743 if (requestData.ContainsKey("estate_owner_uuid"))
744 {
745 // ok, client wants us to use an explicit UUID
746 // regardless of what the avatar name provided
747 userID = new UUID((string) requestData["estate_owner_uuid"]);
748 }
749 else if (requestData.ContainsKey("estate_owner_first") & requestData.ContainsKey("estate_owner_last"))
750 {
751 // We need to look up the UUID for the avatar with the provided name.
752 string ownerFirst = (string) requestData["estate_owner_first"];
753 string ownerLast = (string) requestData["estate_owner_last"];
754
755 Scene currentOrFirst = m_application.SceneManager.CurrentOrFirstScene;
756 IUserAccountService accountService = currentOrFirst.UserAccountService;
757 UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID,
758 ownerFirst, ownerLast);
759 userID = user.PrincipalID;
760 }
761 else
762 {
763 throw new Exception("Estate owner details not provided.");
764 }
765
766 // Create a new estate with the name provided
767 region.EstateSettings = m_application.StorageManager.EstateDataStore.LoadEstateSettings(region.RegionID, true);
768
769 region.EstateSettings.EstateName = (string) requestData["estate_name"];
770 region.EstateSettings.EstateOwner = userID;
771 // Persistence does not seem to effect the need to save a new estate
772 region.EstateSettings.Save();
773 }
774 else
775 {
776 int estateID = estateIDs[0];
777
778 region.EstateSettings = m_application.StorageManager.EstateDataStore.LoadEstateSettings(estateID);
779
780 if (!m_application.StorageManager.EstateDataStore.LinkRegion(region.RegionID, estateID))
781 throw new Exception("Failed to join estate.");
782 }
783
744 // Create the region and perform any initial initialization 784 // Create the region and perform any initial initialization
745 785
746 IScene newScene; 786 IScene newScene;
@@ -749,9 +789,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
749 // If an access specification was provided, use it. 789 // If an access specification was provided, use it.
750 // Otherwise accept the default. 790 // Otherwise accept the default.
751 newScene.RegionInfo.EstateSettings.PublicAccess = GetBoolean(requestData, "public", m_publicAccess); 791 newScene.RegionInfo.EstateSettings.PublicAccess = GetBoolean(requestData, "public", m_publicAccess);
752 newScene.RegionInfo.EstateSettings.EstateOwner = userID; 792 newScene.RegionInfo.EstateSettings.Save();
753 if (persist)
754 newScene.RegionInfo.EstateSettings.Save();
755 793
756 // enable voice on newly created region if 794 // enable voice on newly created region if
757 // requested by either the XmlRpc request or the 795 // requested by either the XmlRpc request or the
@@ -1615,7 +1653,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1615 if (destinationFolder.Type != (short)AssetType.Clothing) 1653 if (destinationFolder.Type != (short)AssetType.Clothing)
1616 { 1654 {
1617 destinationFolder = new InventoryFolderBase(); 1655 destinationFolder = new InventoryFolderBase();
1618 1656
1619 destinationFolder.ID = UUID.Random(); 1657 destinationFolder.ID = UUID.Random();
1620 destinationFolder.Name = "Clothing"; 1658 destinationFolder.Name = "Clothing";
1621 destinationFolder.Owner = destination; 1659 destinationFolder.Owner = destination;
@@ -3100,7 +3138,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
3100 /// <param name="password"></param> 3138 /// <param name="password"></param>
3101 private bool ChangeUserPassword(string firstName, string lastName, string password) 3139 private bool ChangeUserPassword(string firstName, string lastName, string password)
3102 { 3140 {
3103 Scene scene = m_application.SceneManager.CurrentOrFirstScene; 3141 Scene scene = m_application.SceneManager.CurrentOrFirstScene;
3104 IUserAccountService userAccountService = scene.UserAccountService; 3142 IUserAccountService userAccountService = scene.UserAccountService;
3105 IAuthenticationService authenticationService = scene.AuthenticationService; 3143 IAuthenticationService authenticationService = scene.AuthenticationService;
3106 3144
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
index 84c6916..faab371 100644
--- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
+++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
@@ -1028,11 +1028,15 @@ namespace OpenSim.Client.MXP.ClientStack
1028 // Need to translate to MXP somehow 1028 // Need to translate to MXP somehow
1029 } 1029 }
1030 1030
1031 public void SendTeleportLocationStart() 1031 public void SendTeleportStart(uint flags)
1032 { 1032 {
1033 // Need to translate to MXP somehow 1033 // Need to translate to MXP somehow
1034 } 1034 }
1035 1035
1036 public void SendTeleportProgress(uint flags, string message)
1037 {
1038 }
1039
1036 public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) 1040 public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance)
1037 { 1041 {
1038 // Need to translate to MXP somehow 1042 // Need to translate to MXP somehow
diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
index 6ad5f5a..e36b797 100644
--- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
+++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
@@ -583,7 +583,12 @@ namespace OpenSim.Client.Sirikata.ClientStack
583 throw new System.NotImplementedException(); 583 throw new System.NotImplementedException();
584 } 584 }
585 585
586 public void SendTeleportLocationStart() 586 public void SendTeleportStart(uint flags)
587 {
588 throw new System.NotImplementedException();
589 }
590
591 public void SendTeleportProgress(uint flags, string message)
587 { 592 {
588 throw new System.NotImplementedException(); 593 throw new System.NotImplementedException();
589 } 594 }
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
index 8ef411b..51c5c17 100644
--- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
+++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
@@ -589,7 +589,12 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
589 throw new System.NotImplementedException(); 589 throw new System.NotImplementedException();
590 } 590 }
591 591
592 public void SendTeleportLocationStart() 592 public void SendTeleportStart(uint flags)
593 {
594 throw new System.NotImplementedException();
595 }
596
597 public void SendTeleportProgress(uint flags, string message)
593 { 598 {
594 throw new System.NotImplementedException(); 599 throw new System.NotImplementedException();
595 } 600 }
diff --git a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs
index 7c176c7..7d017a6 100644
--- a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs
@@ -1017,7 +1017,7 @@ VALUES
1017 prim.SitName = (string)primRow["SitName"]; 1017 prim.SitName = (string)primRow["SitName"];
1018 prim.TouchName = (string)primRow["TouchName"]; 1018 prim.TouchName = (string)primRow["TouchName"];
1019 // permissions 1019 // permissions
1020 prim.ObjectFlags = Convert.ToUInt32(primRow["ObjectFlags"]); 1020 prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]);
1021 prim.CreatorID = new UUID((Guid)primRow["CreatorID"]); 1021 prim.CreatorID = new UUID((Guid)primRow["CreatorID"]);
1022 prim.OwnerID = new UUID((Guid)primRow["OwnerID"]); 1022 prim.OwnerID = new UUID((Guid)primRow["OwnerID"]);
1023 prim.GroupID = new UUID((Guid)primRow["GroupID"]); 1023 prim.GroupID = new UUID((Guid)primRow["GroupID"]);
@@ -1408,7 +1408,7 @@ VALUES
1408 parameters.Add(_Database.CreateParameter("SitName", prim.SitName)); 1408 parameters.Add(_Database.CreateParameter("SitName", prim.SitName));
1409 parameters.Add(_Database.CreateParameter("TouchName", prim.TouchName)); 1409 parameters.Add(_Database.CreateParameter("TouchName", prim.TouchName));
1410 // permissions 1410 // permissions
1411 parameters.Add(_Database.CreateParameter("ObjectFlags", prim.ObjectFlags)); 1411 parameters.Add(_Database.CreateParameter("ObjectFlags", (uint)prim.Flags));
1412 parameters.Add(_Database.CreateParameter("CreatorID", prim.CreatorID)); 1412 parameters.Add(_Database.CreateParameter("CreatorID", prim.CreatorID));
1413 parameters.Add(_Database.CreateParameter("OwnerID", prim.OwnerID)); 1413 parameters.Add(_Database.CreateParameter("OwnerID", prim.OwnerID));
1414 parameters.Add(_Database.CreateParameter("GroupID", prim.GroupID)); 1414 parameters.Add(_Database.CreateParameter("GroupID", prim.GroupID));
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
index d8debc5..1edcb5d 100644
--- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
@@ -1081,7 +1081,7 @@ namespace OpenSim.Data.MySQL
1081 prim.SitName = (string)row["SitName"]; 1081 prim.SitName = (string)row["SitName"];
1082 prim.TouchName = (string)row["TouchName"]; 1082 prim.TouchName = (string)row["TouchName"];
1083 // Permissions 1083 // Permissions
1084 prim.ObjectFlags = (uint)(int)row["ObjectFlags"]; 1084 prim.Flags = (PrimFlags)(int)row["ObjectFlags"];
1085 prim.OwnerMask = (uint)(int)row["OwnerMask"]; 1085 prim.OwnerMask = (uint)(int)row["OwnerMask"];
1086 prim.NextOwnerMask = (uint)(int)row["NextOwnerMask"]; 1086 prim.NextOwnerMask = (uint)(int)row["NextOwnerMask"];
1087 prim.GroupMask = (uint)(int)row["GroupMask"]; 1087 prim.GroupMask = (uint)(int)row["GroupMask"];
@@ -1414,7 +1414,7 @@ namespace OpenSim.Data.MySQL
1414 cmd.Parameters.AddWithValue("SitName", prim.SitName); 1414 cmd.Parameters.AddWithValue("SitName", prim.SitName);
1415 cmd.Parameters.AddWithValue("TouchName", prim.TouchName); 1415 cmd.Parameters.AddWithValue("TouchName", prim.TouchName);
1416 // permissions 1416 // permissions
1417 cmd.Parameters.AddWithValue("ObjectFlags", prim.ObjectFlags); 1417 cmd.Parameters.AddWithValue("ObjectFlags", (uint)prim.Flags);
1418 cmd.Parameters.AddWithValue("CreatorID", prim.CreatorID.ToString()); 1418 cmd.Parameters.AddWithValue("CreatorID", prim.CreatorID.ToString());
1419 cmd.Parameters.AddWithValue("OwnerID", prim.OwnerID.ToString()); 1419 cmd.Parameters.AddWithValue("OwnerID", prim.OwnerID.ToString());
1420 cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString()); 1420 cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString());
diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
index 893f105..2706aea 100644
--- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Data.SQLite
66 66
67 if (words.Length == 1) 67 if (words.Length == 1)
68 { 68 {
69 cmd.CommandText = String.Format("select * from {0} where ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')", 69 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')",
70 m_Realm, scopeID.ToString(), words[0]); 70 m_Realm, scopeID.ToString(), words[0]);
71 } 71 }
72 else 72 else
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs
index eb78037..289fd94 100644
--- a/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs
@@ -1187,7 +1187,7 @@ namespace OpenSim.Data.SQLiteLegacy
1187 prim.SitName = (String) row["SitName"]; 1187 prim.SitName = (String) row["SitName"];
1188 prim.TouchName = (String) row["TouchName"]; 1188 prim.TouchName = (String) row["TouchName"];
1189 // permissions 1189 // permissions
1190 prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]); 1190 prim.Flags = (PrimFlags)Convert.ToUInt32(row["ObjectFlags"]);
1191 prim.CreatorID = new UUID((String) row["CreatorID"]); 1191 prim.CreatorID = new UUID((String) row["CreatorID"]);
1192 prim.OwnerID = new UUID((String) row["OwnerID"]); 1192 prim.OwnerID = new UUID((String) row["OwnerID"]);
1193 prim.GroupID = new UUID((String) row["GroupID"]); 1193 prim.GroupID = new UUID((String) row["GroupID"]);
@@ -1521,7 +1521,7 @@ namespace OpenSim.Data.SQLiteLegacy
1521 row["SitName"] = prim.SitName; 1521 row["SitName"] = prim.SitName;
1522 row["TouchName"] = prim.TouchName; 1522 row["TouchName"] = prim.TouchName;
1523 // permissions 1523 // permissions
1524 row["ObjectFlags"] = prim.ObjectFlags; 1524 row["ObjectFlags"] = (uint)prim.Flags;
1525 row["CreatorID"] = prim.CreatorID.ToString(); 1525 row["CreatorID"] = prim.CreatorID.ToString();
1526 row["OwnerID"] = prim.OwnerID.ToString(); 1526 row["OwnerID"] = prim.OwnerID.ToString();
1527 row["GroupID"] = prim.GroupID.ToString(); 1527 row["GroupID"] = prim.GroupID.ToString();
diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs
index eeffdda..3cd9e0b 100644
--- a/OpenSim/Data/Tests/RegionTests.cs
+++ b/OpenSim/Data/Tests/RegionTests.cs
@@ -317,7 +317,7 @@ namespace OpenSim.Data.Tests
317 sop.CreatorID = creator; 317 sop.CreatorID = creator;
318 sop.InventorySerial = iserial; 318 sop.InventorySerial = iserial;
319 sop.TaskInventory = dic; 319 sop.TaskInventory = dic;
320 sop.ObjectFlags = objf; 320 sop.Flags = (PrimFlags)objf;
321 sop.Name = name; 321 sop.Name = name;
322 sop.Material = material; 322 sop.Material = material;
323 sop.ScriptAccessPin = pin; 323 sop.ScriptAccessPin = pin;
@@ -350,7 +350,7 @@ namespace OpenSim.Data.Tests
350 // Modified in-class 350 // Modified in-class
351 // Assert.That(iserial,Is.EqualTo(sop.InventorySerial), "Assert.That(iserial,Is.EqualTo(sop.InventorySerial))"); 351 // Assert.That(iserial,Is.EqualTo(sop.InventorySerial), "Assert.That(iserial,Is.EqualTo(sop.InventorySerial))");
352 Assert.That(dic,Is.EqualTo(sop.TaskInventory), "Assert.That(dic,Is.EqualTo(sop.TaskInventory))"); 352 Assert.That(dic,Is.EqualTo(sop.TaskInventory), "Assert.That(dic,Is.EqualTo(sop.TaskInventory))");
353 Assert.That(objf,Is.EqualTo(sop.ObjectFlags), "Assert.That(objf,Is.EqualTo(sop.ObjectFlags))"); 353 Assert.That(objf, Is.EqualTo((uint)sop.Flags), "Assert.That(objf,Is.EqualTo(sop.Flags))");
354 Assert.That(name,Is.EqualTo(sop.Name), "Assert.That(name,Is.EqualTo(sop.Name))"); 354 Assert.That(name,Is.EqualTo(sop.Name), "Assert.That(name,Is.EqualTo(sop.Name))");
355 Assert.That(material,Is.EqualTo(sop.Material), "Assert.That(material,Is.EqualTo(sop.Material))"); 355 Assert.That(material,Is.EqualTo(sop.Material), "Assert.That(material,Is.EqualTo(sop.Material))");
356 Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin))"); 356 Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin))");
@@ -373,7 +373,7 @@ namespace OpenSim.Data.Tests
373 Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))"); 373 Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))");
374 374
375 // This is necessary or object will not be inserted in DB 375 // This is necessary or object will not be inserted in DB
376 sop.ObjectFlags = 0; 376 sop.Flags = PrimFlags.None;
377 377
378 SceneObjectGroup sog = new SceneObjectGroup(sop); 378 SceneObjectGroup sog = new SceneObjectGroup(sop);
379 379
@@ -398,7 +398,7 @@ namespace OpenSim.Data.Tests
398 Assert.That(creator,Is.EqualTo(p.CreatorID), "Assert.That(creator,Is.EqualTo(p.CreatorID))"); 398 Assert.That(creator,Is.EqualTo(p.CreatorID), "Assert.That(creator,Is.EqualTo(p.CreatorID))");
399 //Assert.That(iserial,Is.EqualTo(p.InventorySerial), "Assert.That(iserial,Is.EqualTo(p.InventorySerial))"); 399 //Assert.That(iserial,Is.EqualTo(p.InventorySerial), "Assert.That(iserial,Is.EqualTo(p.InventorySerial))");
400 Assert.That(dic,Is.EqualTo(p.TaskInventory), "Assert.That(dic,Is.EqualTo(p.TaskInventory))"); 400 Assert.That(dic,Is.EqualTo(p.TaskInventory), "Assert.That(dic,Is.EqualTo(p.TaskInventory))");
401 //Assert.That(objf,Is.EqualTo(p.ObjectFlags), "Assert.That(objf,Is.EqualTo(p.ObjectFlags))"); 401 //Assert.That(objf, Is.EqualTo((uint)p.Flags), "Assert.That(objf,Is.EqualTo(p.Flags))");
402 Assert.That(name,Is.EqualTo(p.Name), "Assert.That(name,Is.EqualTo(p.Name))"); 402 Assert.That(name,Is.EqualTo(p.Name), "Assert.That(name,Is.EqualTo(p.Name))");
403 Assert.That(material,Is.EqualTo(p.Material), "Assert.That(material,Is.EqualTo(p.Material))"); 403 Assert.That(material,Is.EqualTo(p.Material), "Assert.That(material,Is.EqualTo(p.Material))");
404 Assert.That(pin,Is.EqualTo(p.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(p.ScriptAccessPin))"); 404 Assert.That(pin,Is.EqualTo(p.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(p.ScriptAccessPin))");
diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs
index 87d9e61..30c5172 100644
--- a/OpenSim/Framework/AvatarWearable.cs
+++ b/OpenSim/Framework/AvatarWearable.cs
@@ -34,8 +34,23 @@ namespace OpenSim.Framework
34{ 34{
35 public class AvatarWearable 35 public class AvatarWearable
36 { 36 {
37 public UUID AssetID = new UUID("00000000-0000-0000-0000-000000000000"); 37 public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9");
38 public UUID ItemID = new UUID("00000000-0000-0000-0000-000000000000"); 38 public static readonly UUID DEFAULT_BODY_ASSET = new UUID("66c41e39-38f9-f75a-024e-585989bfab73");
39
40 public static readonly UUID DEFAULT_HAIR_ITEM = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66");
41 public static readonly UUID DEFAULT_HAIR_ASSET = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66");
42
43 public static readonly UUID DEFAULT_SKIN_ITEM = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9");
44 public static readonly UUID DEFAULT_SKIN_ASSET = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb");
45
46 public static readonly UUID DEFAULT_SHIRT_ITEM = new UUID("77c41e39-38f9-f75a-0000-585989bf0000");
47 public static readonly UUID DEFAULT_SHIRT_ASSET = new UUID("00000000-38f9-1111-024e-222222111110");
48
49 public static readonly UUID DEFAULT_PANTS_ITEM = new UUID("77c41e39-38f9-f75a-0000-5859892f1111");
50 public static readonly UUID DEFAULT_PANTS_ASSET = new UUID("00000000-38f9-1111-024e-222222111120");
51
52 public UUID AssetID;
53 public UUID ItemID;
39 54
40 public AvatarWearable() 55 public AvatarWearable()
41 { 56 {
@@ -58,24 +73,24 @@ namespace OpenSim.Framework
58 } 73 }
59 74
60 // Body 75 // Body
61 defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); 76 defaultWearables[0].ItemID = DEFAULT_BODY_ITEM;
62 defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); 77 defaultWearables[0].AssetID = DEFAULT_BODY_ASSET;
63 78
64 // Hair 79 // Hair
65 defaultWearables[2].ItemID = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66"); 80 defaultWearables[2].ItemID = DEFAULT_HAIR_ITEM;
66 defaultWearables[2].AssetID = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66"); 81 defaultWearables[2].AssetID = DEFAULT_HAIR_ASSET;
67 82
68 // Skin 83 // Skin
69 defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9"); 84 defaultWearables[1].ItemID = DEFAULT_SKIN_ITEM;
70 defaultWearables[1].AssetID = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb"); 85 defaultWearables[1].AssetID = DEFAULT_SKIN_ASSET;
71 86
72 // Shirt 87 // Shirt
73 defaultWearables[4].ItemID = new UUID("77c41e39-38f9-f75a-0000-585989bf0000"); 88 defaultWearables[4].ItemID = DEFAULT_SHIRT_ITEM;
74 defaultWearables[4].AssetID = new UUID("00000000-38f9-1111-024e-222222111110"); 89 defaultWearables[4].AssetID = DEFAULT_SHIRT_ASSET;
75 90
76 // Pants 91 // Pants
77 defaultWearables[5].ItemID = new UUID("77c41e39-38f9-f75a-0000-5859892f1111"); 92 defaultWearables[5].ItemID = DEFAULT_PANTS_ITEM;
78 defaultWearables[5].AssetID = new UUID("00000000-38f9-1111-024e-222222111120"); 93 defaultWearables[5].AssetID = DEFAULT_PANTS_ASSET;
79 94
80 return defaultWearables; 95 return defaultWearables;
81 } 96 }
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 07bded6..9025dda 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -1017,7 +1017,9 @@ namespace OpenSim.Framework
1017 uint flags, string capsURL); 1017 uint flags, string capsURL);
1018 1018
1019 void SendTeleportFailed(string reason); 1019 void SendTeleportFailed(string reason);
1020 void SendTeleportLocationStart(); 1020 void SendTeleportStart(uint flags);
1021 void SendTeleportProgress(uint flags, string message);
1022
1021 void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance); 1023 void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance);
1022 void SendPayPrice(UUID objectID, int[] payPrice); 1024 void SendPayPrice(UUID objectID, int[] payPrice);
1023 1025
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs
index 09f7bea..e69e3fc 100644
--- a/OpenSim/Region/Application/ConfigurationLoader.cs
+++ b/OpenSim/Region/Application/ConfigurationLoader.cs
@@ -211,7 +211,17 @@ namespace OpenSim
211 else 211 else
212 { 212 {
213 string basepath = Path.GetFullPath(Util.configDir()); 213 string basepath = Path.GetFullPath(Util.configDir());
214 string path = Path.Combine(basepath, file); 214 // Resolve relative paths with wildcards
215 string chunkWithoutWildcards = file;
216 string chunkWithWildcards = string.Empty;
217 int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' });
218 if (wildcardIndex != -1)
219 {
220 chunkWithoutWildcards = file.Substring(0, wildcardIndex);
221 chunkWithWildcards = file.Substring(wildcardIndex);
222 }
223 string path = Path.Combine(basepath, chunkWithoutWildcards);
224 path = Path.GetFullPath(path) + chunkWithWildcards;
215 string[] paths = Util.Glob(path); 225 string[] paths = Util.Glob(path);
216 foreach (string p in paths) 226 foreach (string p in paths)
217 { 227 {
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index cb48ac1..bbc42e6 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -418,7 +418,7 @@ namespace OpenSim
418 { 418 {
419 MainConsole.Instance.Output( 419 MainConsole.Instance.Output(
420 String.Format( 420 String.Format(
421 "Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}", 421 "Kicking user: {0,-16} {1,-16} {2,-37} in region: {3,-16}",
422 presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName)); 422 presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName));
423 423
424 // kick client... 424 // kick client...
@@ -530,7 +530,10 @@ namespace OpenSim
530 regionFile = cmd[3]; 530 regionFile = cmd[3];
531 531
532 IScene scene; 532 IScene scene;
533 CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene); 533 RegionInfo regInfo = new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source);
534 PopulateRegionEstateInfo(regInfo);
535 CreateRegion(regInfo, true, out scene);
536 regInfo.EstateSettings.Save();
534 } 537 }
535 else if (cmd[3].EndsWith(".ini")) 538 else if (cmd[3].EndsWith(".ini"))
536 { 539 {
@@ -541,7 +544,10 @@ namespace OpenSim
541 regionFile = cmd[3]; 544 regionFile = cmd[3];
542 545
543 IScene scene; 546 IScene scene;
544 CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]), true, out scene); 547 RegionInfo regInfo = new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]);
548 PopulateRegionEstateInfo(regInfo);
549 CreateRegion(regInfo, true, out scene);
550 regInfo.EstateSettings.Save();
545 } 551 }
546 else 552 else
547 { 553 {
@@ -861,7 +867,7 @@ namespace OpenSim
861 MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count)); 867 MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count));
862 868
863 MainConsole.Instance.Output( 869 MainConsole.Instance.Output(
864 String.Format("{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}{5,-30}", "Firstname", "Lastname", 870 String.Format("{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}", "Firstname", "Lastname",
865 "Agent ID", "Root/Child", "Region", "Position")); 871 "Agent ID", "Root/Child", "Region", "Position"));
866 872
867 foreach (ScenePresence presence in agents) 873 foreach (ScenePresence presence in agents)
@@ -880,7 +886,7 @@ namespace OpenSim
880 886
881 MainConsole.Instance.Output( 887 MainConsole.Instance.Output(
882 String.Format( 888 String.Format(
883 "{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}{5,-30}", 889 "{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}",
884 presence.Firstname, 890 presence.Firstname,
885 presence.Lastname, 891 presence.Lastname,
886 presence.UUID, 892 presence.UUID,
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index fc67f94..c08da18 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -395,9 +395,13 @@ namespace OpenSim
395 scene.SnmpService.BootInfo("Creating region texture", scene); 395 scene.SnmpService.BootInfo("Creating region texture", scene);
396 } 396 }
397 397
398 // moved these here as the terrain texture has to be created after the modules are initialized 398 // moved these here as the map texture has to be created after the modules are initialized
399 // and has to happen before the region is registered with the grid. 399 // and has to happen before the region is registered with the grid.
400 scene.CreateTerrainTexture(); 400 IWorldMapModule mapModule = scene.RequestModuleInterface<IWorldMapModule>();
401 if (mapModule != null)
402 mapModule.GenerateMaptile();
403 else
404 m_log.WarnFormat("[STARTUP]: No map module available to generate map tile");
401 405
402 // TODO : Try setting resource for region xstats here on scene 406 // TODO : Try setting resource for region xstats here on scene
403 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); 407 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
@@ -867,6 +871,60 @@ namespace OpenSim
867 { 871 {
868 regionnum = m_sceneManager.Scenes.Count; 872 regionnum = m_sceneManager.Scenes.Count;
869 } 873 }
874
875 /// <summary>
876 /// Load the estate information for the provided RegionInfo object.
877 /// </summary>
878 /// <param name="regInfo">
879 /// A <see cref="RegionInfo"/>
880 /// </param>
881 public void PopulateRegionEstateInfo(RegionInfo regInfo)
882 {
883 if (m_storageManager.EstateDataStore != null)
884 {
885 regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, false);
886 }
887
888 if (regInfo.EstateSettings.EstateID == 0) // No record at all
889 {
890 MainConsole.Instance.Output("Your region is not part of an estate.");
891 while (true)
892 {
893 string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() {"yes", "no"});
894 if (response == "no")
895 {
896 // Create a new estate
897 regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, true);
898
899 regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
900 //regInfo.EstateSettings.Save();
901 break;
902 }
903 else
904 {
905 response = MainConsole.Instance.CmdPrompt("Estate name to join", "None");
906 if (response == "None")
907 continue;
908
909 List<int> estateIDs = m_storageManager.EstateDataStore.GetEstates(response);
910 if (estateIDs.Count < 1)
911 {
912 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again");
913 continue;
914 }
915
916 int estateID = estateIDs[0];
917
918 regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID);
919
920 if (m_storageManager.EstateDataStore.LinkRegion(regInfo.RegionID, estateID))
921 break;
922
923 MainConsole.Instance.Output("Joining the estate failed. Please try again.");
924 }
925 }
926 }
927 }
870 } 928 }
871 929
872 930
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 48465d9..d41df3d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1442,16 +1442,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1442 /// <summary> 1442 /// <summary>
1443 /// 1443 ///
1444 /// </summary> 1444 /// </summary>
1445 public void SendTeleportLocationStart() 1445 public void SendTeleportStart(uint flags)
1446 { 1446 {
1447 //TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart); 1447 TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart);
1448 TeleportStartPacket tpStart = new TeleportStartPacket(); 1448 //TeleportStartPacket tpStart = new TeleportStartPacket();
1449 tpStart.Info.TeleportFlags = 16; // Teleport via location 1449 tpStart.Info.TeleportFlags = flags; //16; // Teleport via location
1450 1450
1451 // Hack to get this out immediately and skip throttles 1451 // Hack to get this out immediately and skip throttles
1452 OutPacket(tpStart, ThrottleOutPacketType.Unknown); 1452 OutPacket(tpStart, ThrottleOutPacketType.Unknown);
1453 } 1453 }
1454 1454
1455 public void SendTeleportProgress(uint flags, string message)
1456 {
1457 TeleportProgressPacket tpProgress = (TeleportProgressPacket)PacketPool.Instance.GetPacket(PacketType.TeleportProgress);
1458 tpProgress.AgentData.AgentID = this.AgentId;
1459 tpProgress.Info.TeleportFlags = flags;
1460 tpProgress.Info.Message = Util.StringToBytes256(message);
1461
1462 // Hack to get this out immediately and skip throttles
1463 OutPacket(tpProgress, ThrottleOutPacketType.Unknown);
1464 }
1465
1455 public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) 1466 public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance)
1456 { 1467 {
1457 MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket)PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply); 1468 MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket)PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply);
@@ -3041,7 +3052,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3041 { 3052 {
3042 OSDMap GroupDataMap = new OSDMap(6); 3053 OSDMap GroupDataMap = new OSDMap(6);
3043 OSDMap NewGroupDataMap = new OSDMap(1); 3054 OSDMap NewGroupDataMap = new OSDMap(1);
3044 GroupDataMap.Add("GroupPowers", OSD.FromBinary(m.GroupPowers)); 3055 GroupDataMap.Add("GroupPowers", OSD.FromULong(m.GroupPowers));
3045 GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(m.AcceptNotices)); 3056 GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(m.AcceptNotices));
3046 GroupDataMap.Add("GroupTitle", OSD.FromString(m.GroupTitle)); 3057 GroupDataMap.Add("GroupTitle", OSD.FromString(m.GroupTitle));
3047 GroupDataMap.Add("GroupID", OSD.FromUUID(m.GroupID)); 3058 GroupDataMap.Add("GroupID", OSD.FromUUID(m.GroupID));
@@ -6332,7 +6343,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6332 } 6343 }
6333 #endregion 6344 #endregion
6334 6345
6335 ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData; 6346// ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData;
6336 6347
6337 ObjectDuplicate handlerObjectDuplicate = null; 6348 ObjectDuplicate handlerObjectDuplicate = null;
6338 6349
@@ -11765,8 +11776,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11765 { 11776 {
11766 StringBuilder sb = new StringBuilder(); 11777 StringBuilder sb = new StringBuilder();
11767 sb.Append("["); 11778 sb.Append("[");
11768 if (this.priority != null) 11779 sb.Append(this.priority.ToString());
11769 sb.Append(this.priority.ToString());
11770 sb.Append(","); 11780 sb.Append(",");
11771 if (this.value != null) 11781 if (this.value != null)
11772 sb.Append(this.value.ToString()); 11782 sb.Append(this.value.ToString());
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index e683821..46b68ec 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -58,6 +58,11 @@ namespace OpenSim.Region.ClientStack
58 58
59 protected StorageManager m_storageManager; 59 protected StorageManager m_storageManager;
60 60
61 public StorageManager StorageManager
62 {
63 get { return m_storageManager; }
64 }
65
61 protected ClientStackManager m_clientStackManager; 66 protected ClientStackManager m_clientStackManager;
62 67
63 public SceneManager SceneManager 68 public SceneManager SceneManager
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
index a895d6e..032e55a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
@@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
93 { 93 {
94 string deadAvatarMessage; 94 string deadAvatarMessage;
95 ScenePresence killingAvatar = null; 95 ScenePresence killingAvatar = null;
96 string killingAvatarMessage; 96// string killingAvatarMessage;
97 97
98 if (killerObjectLocalID == 0) 98 if (killerObjectLocalID == 0)
99 deadAvatarMessage = "You committed suicide!"; 99 deadAvatarMessage = "You committed suicide!";
@@ -118,14 +118,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
118 deadAvatarMessage = String.Format("You impaled yourself on {0} owned by {1}!", part.Name, deadAvatar.Scene.GetUserName(part.OwnerID)); 118 deadAvatarMessage = String.Format("You impaled yourself on {0} owned by {1}!", part.Name, deadAvatar.Scene.GetUserName(part.OwnerID));
119 else 119 else
120 { 120 {
121 killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); 121// killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name);
122 deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name); 122 deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name);
123 } 123 }
124 } 124 }
125 } 125 }
126 else 126 else
127 { 127 {
128 killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); 128// killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name);
129 deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name); 129 deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name);
130 } 130 }
131 } 131 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
index 98545f9..4465e8a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -82,6 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
82 scene.EventManager.OnNewClient += OnNewClient; 82 scene.EventManager.OnNewClient += OnNewClient;
83 scene.EventManager.OnClientClosed += ClientLoggedOut; 83 scene.EventManager.OnClientClosed += ClientLoggedOut;
84 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; 84 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
85 scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene;
85 } 86 }
86 87
87 public void RegionLoaded(Scene scene) 88 public void RegionLoaded(Scene scene)
@@ -98,9 +99,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
98 scene.EventManager.OnNewClient -= OnNewClient; 99 scene.EventManager.OnNewClient -= OnNewClient;
99 scene.EventManager.OnClientClosed -= ClientLoggedOut; 100 scene.EventManager.OnClientClosed -= ClientLoggedOut;
100 scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; 101 scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
102 scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene;
101 } 103 }
102 } 104 }
103
104 } 105 }
105 106
106 public void RemoveRegion(Scene scene) 107 public void RemoveRegion(Scene scene)
@@ -108,6 +109,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
108 scene.EventManager.OnNewClient -= OnNewClient; 109 scene.EventManager.OnNewClient -= OnNewClient;
109 scene.EventManager.OnClientClosed -= ClientLoggedOut; 110 scene.EventManager.OnClientClosed -= ClientLoggedOut;
110 scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; 111 scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
112 scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene;
111 m_Scenelist.Remove(scene); 113 m_Scenelist.Remove(scene);
112 } 114 }
113 115
@@ -136,6 +138,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
136 // Inventory giving is conducted via instant message 138 // Inventory giving is conducted via instant message
137 client.OnInstantMessage += OnInstantMessage; 139 client.OnInstantMessage += OnInstantMessage;
138 } 140 }
141
142 protected void OnSetRootAgentScene(UUID id, Scene scene)
143 {
144 m_AgentRegions[id] = scene;
145 }
139 146
140 private Scene FindClientScene(UUID agentId) 147 private Scene FindClientScene(UUID agentId)
141 { 148 {
@@ -160,7 +167,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
160 if (scene == null) // Something seriously wrong here. 167 if (scene == null) // Something seriously wrong here.
161 return; 168 return;
162 169
163
164 if (im.dialog == (byte) InstantMessageDialog.InventoryOffered) 170 if (im.dialog == (byte) InstantMessageDialog.InventoryOffered)
165 { 171 {
166 //m_log.DebugFormat("Asset type {0}", ((AssetType)im.binaryBucket[0])); 172 //m_log.DebugFormat("Asset type {0}", ((AssetType)im.binaryBucket[0]));
@@ -348,11 +354,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
348 } 354 }
349 } 355 }
350 356
351 public void SetRootAgentScene(UUID agentID, Scene scene)
352 {
353 m_AgentRegions[agentID] = scene;
354 }
355
356 public bool NeedSceneCacheClear(UUID agentID, Scene scene) 357 public bool NeedSceneCacheClear(UUID agentID, Scene scene)
357 { 358 {
358 if (!m_AgentRegions.ContainsKey(agentID)) 359 if (!m_AgentRegions.ContainsKey(agentID))
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 1d1a0a1..0ba67d3 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -174,9 +174,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
174 position.Z = newPosZ; 174 position.Z = newPosZ;
175 } 175 }
176 176
177 // Only send this if the event queue is null 177 sp.ControllingClient.SendTeleportStart(teleportFlags);
178 if (eq == null)
179 sp.ControllingClient.SendTeleportLocationStart();
180 178
181 sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags); 179 sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
182 sp.Teleport(position); 180 sp.Teleport(position);
@@ -257,9 +255,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
257 255
258 ulong destinationHandle = finalDestination.RegionHandle; 256 ulong destinationHandle = finalDestination.RegionHandle;
259 257
260 if (eq == null)
261 sp.ControllingClient.SendTeleportLocationStart();
262
263 // Let's do DNS resolution only once in this process, please! 258 // Let's do DNS resolution only once in this process, please!
264 // This may be a costly operation. The reg.ExternalEndPoint field is not a passive field, 259 // This may be a costly operation. The reg.ExternalEndPoint field is not a passive field,
265 // it's actually doing a lot of work. 260 // it's actually doing a lot of work.
@@ -277,6 +272,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
277 return; 272 return;
278 } 273 }
279 274
275 sp.ControllingClient.SendTeleportStart(teleportFlags);
276
280 // the avatar.Close below will clear the child region list. We need this below for (possibly) 277 // the avatar.Close below will clear the child region list. We need this below for (possibly)
281 // closing the child agents, so save it here (we need a copy as it is Clear()-ed). 278 // closing the child agents, so save it here (we need a copy as it is Clear()-ed).
282 //List<ulong> childRegions = new List<ulong>(avatar.GetKnownRegionList()); 279 //List<ulong> childRegions = new List<ulong>(avatar.GetKnownRegionList());
@@ -307,7 +304,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
307 string reason = String.Empty; 304 string reason = String.Empty;
308 305
309 // Let's create an agent there if one doesn't exist yet. 306 // Let's create an agent there if one doesn't exist yet.
310 if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason)) 307 bool logout = false;
308 if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
311 { 309 {
312 sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}", 310 sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}",
313 reason)); 311 reason));
@@ -319,6 +317,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
319 317
320 if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) 318 if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY))
321 { 319 {
320 //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent...");
321
322 #region IP Translation for NAT 322 #region IP Translation for NAT
323 IClientIPEndpoint ipepClient; 323 IClientIPEndpoint ipepClient;
324 if (sp.ClientView.TryGet(out ipepClient)) 324 if (sp.ClientView.TryGet(out ipepClient))
@@ -396,6 +396,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
396 agent.Position = position; 396 agent.Position = position;
397 SetCallbackURL(agent, sp.Scene.RegionInfo); 397 SetCallbackURL(agent, sp.Scene.RegionInfo);
398 398
399 //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent...");
400
399 if (!UpdateAgent(reg, finalDestination, agent)) 401 if (!UpdateAgent(reg, finalDestination, agent))
400 { 402 {
401 // Region doesn't take it 403 // Region doesn't take it
@@ -434,8 +436,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
434 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it 436 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
435 CrossAttachmentsIntoNewRegion(finalDestination, sp, true); 437 CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
436 438
439 // Well, this is it. The agent is over there.
440
437 KillEntity(sp.Scene, sp.LocalId); 441 KillEntity(sp.Scene, sp.LocalId);
438 442
443 // May need to logout or other cleanup
444 AgentHasMovedAway(sp.ControllingClient.SessionId, logout);
445
439 // Now let's make it officially a child agent 446 // Now let's make it officially a child agent
440 sp.MakeChildAgent(); 447 sp.MakeChildAgent();
441 448
@@ -483,8 +490,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
483 490
484 } 491 }
485 492
486 protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) 493 protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
487 { 494 {
495 logout = false;
488 return m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason); 496 return m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason);
489 } 497 }
490 498
@@ -500,6 +508,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
500 508
501 } 509 }
502 510
511 protected virtual void AgentHasMovedAway(UUID sessionID, bool logout)
512 {
513 }
514
503 protected void KillEntity(Scene scene, uint localID) 515 protected void KillEntity(Scene scene, uint localID)
504 { 516 {
505 scene.SendKillObject(localID); 517 scene.SendKillObject(localID);
@@ -1286,18 +1298,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1286 return handles; 1298 return handles;
1287 } 1299 }
1288 1300
1289 private void Dump(string msg, List<ulong> handles) 1301// private void Dump(string msg, List<ulong> handles)
1290 { 1302// {
1291 m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg); 1303// m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg);
1292 foreach (ulong handle in handles) 1304// foreach (ulong handle in handles)
1293 { 1305// {
1294 uint x, y; 1306// uint x, y;
1295 Utils.LongToUInts(handle, out x, out y); 1307// Utils.LongToUInts(handle, out x, out y);
1296 x = x / Constants.RegionSize; 1308// x = x / Constants.RegionSize;
1297 y = y / Constants.RegionSize; 1309// y = y / Constants.RegionSize;
1298 m_log.InfoFormat("({0}, {1})", x, y); 1310// m_log.InfoFormat("({0}, {1})", x, y);
1299 } 1311// }
1300 } 1312// }
1301 1313
1302 #endregion 1314 #endregion
1303 1315
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 7d26e3f..1ac7508 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -140,9 +140,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
140 return false; 140 return false;
141 } 141 }
142 142
143 protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) 143 protected override void AgentHasMovedAway(UUID sessionID, bool logout)
144 {
145 if (logout)
146 // Log them out of this grid
147 m_aScene.PresenceService.LogoutAgent(sessionID);
148 }
149
150 protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
144 { 151 {
145 reason = string.Empty; 152 reason = string.Empty;
153 logout = false;
146 int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID); 154 int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID);
147 if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) 155 if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
148 { 156 {
@@ -152,9 +160,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
152 string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString(); 160 string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString();
153 IUserAgentService connector = new UserAgentServiceConnector(userAgentDriver); 161 IUserAgentService connector = new UserAgentServiceConnector(userAgentDriver);
154 bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason); 162 bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason);
155 if (success) 163 logout = success; // flag for later logout from this grid; this is an HG TP
156 // Log them out of this grid
157 m_aScene.PresenceService.LogoutAgent(agentCircuit.SessionID);
158 164
159 return success; 165 return success;
160 } 166 }
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
index efa60bb..e9bcae3 100644
--- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
+++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
@@ -54,12 +54,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
54 } 54 }
55 55
56 private static byte[] uintToByteArray(uint uIntValue) 56 private static byte[] uintToByteArray(uint uIntValue)
57 { 57 {
58 byte[] resultbytes = Utils.UIntToBytes(uIntValue); 58 byte[] result = new byte[4];
59 if (BitConverter.IsLittleEndian) 59 Utils.UIntToBytesBig(uIntValue, result, 0);
60 Array.Reverse(resultbytes); 60 return result;
61
62 return resultbytes;
63 } 61 }
64 62
65 public static OSD buildEvent(string eventName, OSD eventBody) 63 public static OSD buildEvent(string eventName, OSD eventBody)
@@ -160,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
160 info.Add("SimAccess", OSD.FromInteger(simAccess)); 158 info.Add("SimAccess", OSD.FromInteger(simAccess));
161 info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); 159 info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes()));
162 info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port)); 160 info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port));
163 info.Add("TeleportFlags", OSD.FromBinary(1L << 4)); // AgentManager.TeleportFlags.ViaLocation 161 info.Add("TeleportFlags", OSD.FromULong(1L << 4)); // AgentManager.TeleportFlags.ViaLocation
164 162
165 OSDArray infoArr = new OSDArray(); 163 OSDArray infoArr = new OSDArray();
166 infoArr.Add(info); 164 infoArr.Add(info);
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
index b13b9d8..ccb892e 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
@@ -95,7 +95,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
95 try 95 try
96 { 96 {
97 asset1.ID = url + "/" + asset.ID; 97 asset1.ID = url + "/" + asset.ID;
98 UUID temp = UUID.Zero; 98// UUID temp = UUID.Zero;
99 // TODO: if the creator is local, stick this grid's URL in front 99 // TODO: if the creator is local, stick this grid's URL in front
100 //if (UUID.TryParse(asset.Metadata.CreatorID, out temp)) 100 //if (UUID.TryParse(asset.Metadata.CreatorID, out temp))
101 // asset1.Metadata.CreatorID = ??? + "/" + asset.Metadata.CreatorID; 101 // asset1.Metadata.CreatorID = ??? + "/" + asset.Metadata.CreatorID;
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 8ccc941..c673b31 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
54 get { return m_assMapper; } 54 get { return m_assMapper; }
55 } 55 }
56 56
57 private bool m_Initialized = false; 57// private bool m_Initialized = false;
58 58
59 #region INonSharedRegionModule 59 #region INonSharedRegionModule
60 60
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 2517a23..cc12df0 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -572,7 +572,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
572 } 572 }
573 if (attachment) 573 if (attachment)
574 { 574 {
575 group.RootPart.ObjectFlags |= (uint)PrimFlags.Phantom; 575 group.RootPart.Flags |= PrimFlags.Phantom;
576 group.RootPart.IsAttachment = true; 576 group.RootPart.IsAttachment = true;
577 } 577 }
578 578
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs
index 9c20d68..d570608 100644
--- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs
@@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library
51 private static bool m_HasRunOnce = false; 51 private static bool m_HasRunOnce = false;
52 52
53 private bool m_Enabled = false; 53 private bool m_Enabled = false;
54 private string m_LibraryName = "OpenSim Library"; 54// private string m_LibraryName = "OpenSim Library";
55 private Scene m_Scene; 55 private Scene m_Scene;
56 56
57 private ILibraryService m_Library; 57 private ILibraryService m_Library;
@@ -212,13 +212,13 @@ namespace OpenSim.Region.CoreModules.Framework.Library
212 } 212 }
213 } 213 }
214 214
215 private void DumpLibrary() 215// private void DumpLibrary()
216 { 216// {
217 InventoryFolderImpl lib = m_Library.LibraryRootFolder; 217// InventoryFolderImpl lib = m_Library.LibraryRootFolder;
218 218//
219 m_log.DebugFormat(" - folder {0}", lib.Name); 219// m_log.DebugFormat(" - folder {0}", lib.Name);
220 DumpFolder(lib); 220// DumpFolder(lib);
221 } 221// }
222// 222//
223// private void DumpLibrary() 223// private void DumpLibrary()
224// { 224// {
diff --git a/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs b/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs
new file mode 100644
index 0000000..b75a700
--- /dev/null
+++ b/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs
@@ -0,0 +1,169 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.IO;
31using System.Reflection;
32using log4net;
33using Mono.Addins;
34using Nini.Config;
35using OpenMetaverse;
36using OpenMetaverse.Packets;
37using OpenSim.Framework;
38using OpenSim.Region.Framework;
39using OpenSim.Region.Framework.Interfaces;
40using OpenSim.Region.Framework.Scenes;
41
42namespace OpenSim.Region.CoreModules.Avatar.Attachments
43{
44 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BinaryLoggingModule")]
45 public class BinaryLoggingModule : INonSharedRegionModule
46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48
49 protected bool m_collectStats;
50 protected Scene m_scene = null;
51
52 public string Name { get { return "Binary Statistics Logging Module"; } }
53 public Type ReplaceableInterface { get { return null; } }
54
55 public void Initialise(IConfigSource source)
56 {
57 try
58 {
59 IConfig statConfig = source.Configs["Statistics.Binary"];
60 if (statConfig.Contains("enabled") && statConfig.GetBoolean("enabled"))
61 {
62 if (statConfig.Contains("collect_region_stats"))
63 {
64 if (statConfig.GetBoolean("collect_region_stats"))
65 {
66 m_collectStats = true;
67 }
68 }
69 if (statConfig.Contains("region_stats_period_seconds"))
70 {
71 m_statLogPeriod = TimeSpan.FromSeconds(statConfig.GetInt("region_stats_period_seconds"));
72 }
73 if (statConfig.Contains("stats_dir"))
74 {
75 m_statsDir = statConfig.GetString("stats_dir");
76 }
77 }
78 }
79 catch
80 {
81 // if it doesn't work, we don't collect anything
82 }
83 }
84
85 public void AddRegion(Scene scene)
86 {
87 m_scene = scene;
88 }
89
90 public void RemoveRegion(Scene scene)
91 {
92 }
93
94 public void RegionLoaded(Scene scene)
95 {
96 if (m_collectStats)
97 m_scene.StatsReporter.OnSendStatsResult += LogSimStats;
98 }
99
100 public void Close()
101 {
102 }
103
104 public class StatLogger
105 {
106 public DateTime StartTime;
107 public string Path;
108 public System.IO.BinaryWriter Log;
109 }
110
111 static StatLogger m_statLog = null;
112 static TimeSpan m_statLogPeriod = TimeSpan.FromSeconds(300);
113 static string m_statsDir = String.Empty;
114 static Object m_statLockObject = new Object();
115
116 private void LogSimStats(SimStats stats)
117 {
118 SimStatsPacket pack = new SimStatsPacket();
119 pack.Region = new SimStatsPacket.RegionBlock();
120 pack.Region.RegionX = stats.RegionX;
121 pack.Region.RegionY = stats.RegionY;
122 pack.Region.RegionFlags = stats.RegionFlags;
123 pack.Region.ObjectCapacity = stats.ObjectCapacity;
124 //pack.Region = //stats.RegionBlock;
125 pack.Stat = stats.StatsBlock;
126 pack.Header.Reliable = false;
127
128 // note that we are inside the reporter lock when called
129 DateTime now = DateTime.Now;
130
131 // hide some time information into the packet
132 pack.Header.Sequence = (uint)now.Ticks;
133
134 lock (m_statLockObject) // m_statLog is shared so make sure there is only executer here
135 {
136 try
137 {
138 if (m_statLog == null || now > m_statLog.StartTime + m_statLogPeriod)
139 {
140 // First log file or time has expired, start writing to a new log file
141 if (m_statLog != null && m_statLog.Log != null)
142 {
143 m_statLog.Log.Close();
144 }
145 m_statLog = new StatLogger();
146 m_statLog.StartTime = now;
147 m_statLog.Path = (m_statsDir.Length > 0 ? m_statsDir + System.IO.Path.DirectorySeparatorChar.ToString() : "")
148 + String.Format("stats-{0}.log", now.ToString("yyyyMMddHHmmss"));
149 m_statLog.Log = new BinaryWriter(File.Open(m_statLog.Path, FileMode.Append, FileAccess.Write));
150 }
151
152 // Write the serialized data to disk
153 if (m_statLog != null && m_statLog.Log != null)
154 m_statLog.Log.Write(pack.ToBytes());
155 }
156 catch (Exception ex)
157 {
158 m_log.Error("statistics gathering failed: " + ex.Message, ex);
159 if (m_statLog != null && m_statLog.Log != null)
160 {
161 m_statLog.Log.Close();
162 }
163 m_statLog = null;
164 }
165 }
166 return;
167 }
168 }
169}
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
index e95d2f8..87a0a8d 100644
--- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
@@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
91 private string httpsCN = ""; 91 private string httpsCN = "";
92 private bool httpSSL = false; 92 private bool httpSSL = false;
93 private uint httpsslport = 0; 93 private uint httpsslport = 0;
94 private bool GridMode = false; 94// private bool GridMode = false;
95 95
96 #region IRegionModule Members 96 #region IRegionModule Members
97 97
@@ -126,10 +126,10 @@ namespace OpenSim.Region.CoreModules.InterGrid
126 126
127 } 127 }
128 128
129 if (startupcfg != null) 129// if (startupcfg != null)
130 { 130// {
131 GridMode = enabled = startupcfg.GetBoolean("gridmode", false); 131// GridMode = enabled = startupcfg.GetBoolean("gridmode", false);
132 } 132// }
133 133
134 if (cfg != null) 134 if (cfg != null)
135 { 135 {
@@ -1213,18 +1213,19 @@ namespace OpenSim.Region.CoreModules.InterGrid
1213 } 1213 }
1214 } 1214 }
1215 1215
1216 private string CreateRandomStr(int len) 1216// private string CreateRandomStr(int len)
1217 { 1217// {
1218 Random rnd = new Random(Environment.TickCount); 1218// Random rnd = new Random(Environment.TickCount);
1219 string returnstring = ""; 1219// string returnstring = "";
1220 string chars = "abcdefghijklmnopqrstuvwxyz0123456789"; 1220// string chars = "abcdefghijklmnopqrstuvwxyz0123456789";
1221 1221//
1222 for (int i = 0; i < len; i++) 1222// for (int i = 0; i < len; i++)
1223 { 1223// {
1224 returnstring += chars.Substring(rnd.Next(chars.Length), 1); 1224// returnstring += chars.Substring(rnd.Next(chars.Length), 1);
1225 } 1225// }
1226 return returnstring; 1226// return returnstring;
1227 } 1227// }
1228
1228 // Temporary hack to allow teleporting to and from Vaak 1229 // Temporary hack to allow teleporting to and from Vaak
1229 private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error) 1230 private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
1230 { 1231 {
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
index aa3b30d..153aeec 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
@@ -32,7 +32,6 @@ using System.Reflection;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Statistics; 34using OpenSim.Framework.Statistics;
35
36using OpenSim.Services.Connectors; 35using OpenSim.Services.Connectors;
37using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
@@ -48,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
48 47
49 private bool m_Enabled = false; 48 private bool m_Enabled = false;
50 private bool m_Initialized = false; 49 private bool m_Initialized = false;
51 private Scene m_Scene; 50// private Scene m_Scene;
52 private InventoryServicesConnector m_RemoteConnector; 51 private InventoryServicesConnector m_RemoteConnector;
53 52
54 public Type ReplaceableInterface 53 public Type ReplaceableInterface
@@ -105,7 +104,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
105 104
106 public void AddRegion(Scene scene) 105 public void AddRegion(Scene scene)
107 { 106 {
108 m_Scene = scene; 107// m_Scene = scene;
109 //m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName); 108 //m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName);
110 109
111 if (!m_Enabled) 110 if (!m_Enabled)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
index 277060d..ada26cc 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
@@ -32,7 +32,6 @@ using System.Reflection;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Statistics; 34using OpenSim.Framework.Statistics;
35
36using OpenSim.Services.Connectors; 35using OpenSim.Services.Connectors;
37using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
@@ -48,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
48 47
49 private bool m_Enabled = false; 48 private bool m_Enabled = false;
50 private bool m_Initialized = false; 49 private bool m_Initialized = false;
51 private Scene m_Scene; 50// private Scene m_Scene;
52 private XInventoryServicesConnector m_RemoteConnector; 51 private XInventoryServicesConnector m_RemoteConnector;
53 52
54 public Type ReplaceableInterface 53 public Type ReplaceableInterface
@@ -109,7 +108,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
109 108
110 public void AddRegion(Scene scene) 109 public void AddRegion(Scene scene)
111 { 110 {
112 m_Scene = scene; 111// m_Scene = scene;
113 //m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName); 112 //m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName);
114 113
115 if (!m_Enabled) 114 if (!m_Enabled)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs
index e1bc243..fb2edb9 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
55 if (account != null) 55 if (account != null)
56 m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromMinutes(2.0d)); 56 m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromMinutes(2.0d));
57 57
58 m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); 58 // m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
59 } 59 }
60 60
61 public UserAccount Get(UUID userID, out bool inCache) 61 public UserAccount Get(UUID userID, out bool inCache)
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 27e492b..171e0b9 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -345,7 +345,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
345 { 345 {
346 if (!s.IsChildAgent) 346 if (!s.IsChildAgent)
347 { 347 {
348 s.ControllingClient.SendTeleportLocationStart();
349 m_scene.TeleportClientHome(user, s.ControllingClient); 348 m_scene.TeleportClientHome(user, s.ControllingClient);
350 } 349 }
351 } 350 }
@@ -480,7 +479,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
480 ScenePresence s = m_scene.GetScenePresence(prey); 479 ScenePresence s = m_scene.GetScenePresence(prey);
481 if (s != null) 480 if (s != null)
482 { 481 {
483 s.ControllingClient.SendTeleportLocationStart();
484 m_scene.TeleportClientHome(prey, s.ControllingClient); 482 m_scene.TeleportClientHome(prey, s.ControllingClient);
485 } 483 }
486 } 484 }
@@ -500,7 +498,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
500 // Also make sure they are actually in the region 498 // Also make sure they are actually in the region
501 if (p != null && !p.IsChildAgent) 499 if (p != null && !p.IsChildAgent)
502 { 500 {
503 p.ControllingClient.SendTeleportLocationStart();
504 m_scene.TeleportClientHome(p.UUID, p.ControllingClient); 501 m_scene.TeleportClientHome(p.UUID, p.ControllingClient);
505 } 502 }
506 } 503 }
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 7e29a56..d00cb07 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -147,12 +147,12 @@ namespace OpenSim.Region.CoreModules.World.Land
147 { 147 {
148 } 148 }
149 149
150 private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) 150// private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason)
151 { 151// {
152 ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y); 152// ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y);
153 reason = "You are not allowed to enter this sim."; 153// reason = "You are not allowed to enter this sim.";
154 return nearestParcel != null; 154// return nearestParcel != null;
155 } 155// }
156 156
157 void EventManagerOnNewClient(IClientAPI client) 157 void EventManagerOnNewClient(IClientAPI client)
158 { 158 {
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
new file mode 100644
index 0000000..62abd4c
--- /dev/null
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -0,0 +1,263 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
32using Mono.Addins;
33using Nini.Config;
34using OpenMetaverse;
35using OpenMetaverse.Packets;
36using OpenSim.Framework;
37using OpenSim.Region.Framework;
38using OpenSim.Region.Framework.Interfaces;
39using OpenSim.Region.Framework.Scenes;
40using OpenSim.Region.Framework.Scenes.Serialization;
41
42namespace OpenSim.Region.CoreModules.World.Objects.BuySell
43{
44 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BuySellModule")]
45 public class BuySellModule : IBuySellModule, INonSharedRegionModule
46 {
47// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48
49 protected Scene m_scene = null;
50 protected IDialogModule m_dialogModule;
51
52 public string Name { get { return "Object BuySell Module"; } }
53 public Type ReplaceableInterface { get { return null; } }
54
55 public void Initialise(IConfigSource source) {}
56
57 public void AddRegion(Scene scene)
58 {
59 m_scene = scene;
60 m_scene.RegisterModuleInterface<IBuySellModule>(this);
61 m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
62 }
63
64 public void RemoveRegion(Scene scene)
65 {
66 m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
67 }
68
69 public void RegionLoaded(Scene scene)
70 {
71 m_dialogModule = scene.RequestModuleInterface<IDialogModule>();
72 }
73
74 public void Close()
75 {
76 RemoveRegion(m_scene);
77 }
78
79 public void SubscribeToClientEvents(IClientAPI client)
80 {
81 client.OnObjectSaleInfo += ObjectSaleInfo;
82 }
83
84 protected void ObjectSaleInfo(
85 IClientAPI client, UUID agentID, UUID sessionID, uint localID, byte saleType, int salePrice)
86 {
87 SceneObjectPart part = m_scene.GetSceneObjectPart(localID);
88 if (part == null || part.ParentGroup == null)
89 return;
90
91 if (part.ParentGroup.IsDeleted)
92 return;
93
94 part = part.ParentGroup.RootPart;
95
96 part.ObjectSaleType = saleType;
97 part.SalePrice = salePrice;
98
99 part.ParentGroup.HasGroupChanged = true;
100
101 part.GetProperties(client);
102 }
103
104 public bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType)
105 {
106 SceneObjectPart part = m_scene.GetSceneObjectPart(localID);
107
108 if (part == null)
109 return false;
110
111 if (part.ParentGroup == null)
112 return false;
113
114 SceneObjectGroup group = part.ParentGroup;
115
116 switch (saleType)
117 {
118 case 1: // Sell as original (in-place sale)
119 uint effectivePerms = group.GetEffectivePermissions();
120
121 if ((effectivePerms & (uint)PermissionMask.Transfer) == 0)
122 {
123 if (m_dialogModule != null)
124 m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale");
125 return false;
126 }
127
128 group.SetOwnerId(remoteClient.AgentId);
129 group.SetRootPartOwner(part, remoteClient.AgentId, remoteClient.ActiveGroupId);
130
131 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
132
133 if (m_scene.Permissions.PropagatePermissions())
134 {
135 foreach (SceneObjectPart child in partList)
136 {
137 child.Inventory.ChangeInventoryOwner(remoteClient.AgentId);
138 child.TriggerScriptChangedEvent(Changed.OWNER);
139 child.ApplyNextOwnerPermissions();
140 }
141 }
142
143 part.ObjectSaleType = 0;
144 part.SalePrice = 10;
145
146 group.HasGroupChanged = true;
147 part.GetProperties(remoteClient);
148 part.TriggerScriptChangedEvent(Changed.OWNER);
149 group.ResumeScripts();
150 part.ScheduleFullUpdate();
151
152 break;
153
154 case 2: // Sell a copy
155 Vector3 inventoryStoredPosition = new Vector3
156 (((group.AbsolutePosition.X > (int)Constants.RegionSize)
157 ? 250
158 : group.AbsolutePosition.X)
159 ,
160 (group.AbsolutePosition.X > (int)Constants.RegionSize)
161 ? 250
162 : group.AbsolutePosition.X,
163 group.AbsolutePosition.Z);
164
165 Vector3 originalPosition = group.AbsolutePosition;
166
167 group.AbsolutePosition = inventoryStoredPosition;
168
169 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group);
170 group.AbsolutePosition = originalPosition;
171
172 uint perms = group.GetEffectivePermissions();
173
174 if ((perms & (uint)PermissionMask.Transfer) == 0)
175 {
176 if (m_dialogModule != null)
177 m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale");
178 return false;
179 }
180
181 AssetBase asset = m_scene.CreateAsset(
182 group.GetPartName(localID),
183 group.GetPartDescription(localID),
184 (sbyte)AssetType.Object,
185 Utils.StringToBytes(sceneObjectXml),
186 group.OwnerID);
187 m_scene.AssetService.Store(asset);
188
189 InventoryItemBase item = new InventoryItemBase();
190 item.CreatorId = part.CreatorID.ToString();
191
192 item.ID = UUID.Random();
193 item.Owner = remoteClient.AgentId;
194 item.AssetID = asset.FullID;
195 item.Description = asset.Description;
196 item.Name = asset.Name;
197 item.AssetType = asset.Type;
198 item.InvType = (int)InventoryType.Object;
199 item.Folder = categoryID;
200
201 uint nextPerms=(perms & 7) << 13;
202 if ((nextPerms & (uint)PermissionMask.Copy) == 0)
203 perms &= ~(uint)PermissionMask.Copy;
204 if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
205 perms &= ~(uint)PermissionMask.Transfer;
206 if ((nextPerms & (uint)PermissionMask.Modify) == 0)
207 perms &= ~(uint)PermissionMask.Modify;
208
209 item.BasePermissions = perms & part.NextOwnerMask;
210 item.CurrentPermissions = perms & part.NextOwnerMask;
211 item.NextPermissions = part.NextOwnerMask;
212 item.EveryOnePermissions = part.EveryoneMask &
213 part.NextOwnerMask;
214 item.GroupPermissions = part.GroupMask &
215 part.NextOwnerMask;
216 item.CurrentPermissions |= 16; // Slam!
217 item.CreationDate = Util.UnixTimeSinceEpoch();
218
219 if (m_scene.InventoryService.AddItem(item))
220 {
221 remoteClient.SendInventoryItemCreateUpdate(item, 0);
222 }
223 else
224 {
225 if (m_dialogModule != null)
226 m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable");
227 return false;
228 }
229 break;
230
231 case 3: // Sell contents
232 List<UUID> invList = part.Inventory.GetInventoryList();
233
234 bool okToSell = true;
235
236 foreach (UUID invID in invList)
237 {
238 TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID);
239 if ((item1.CurrentPermissions &
240 (uint)PermissionMask.Transfer) == 0)
241 {
242 okToSell = false;
243 break;
244 }
245 }
246
247 if (!okToSell)
248 {
249 if (m_dialogModule != null)
250 m_dialogModule.SendAlertToUser(
251 remoteClient, "This item's inventory doesn't appear to be for sale");
252 return false;
253 }
254
255 if (invList.Count > 0)
256 m_scene.MoveTaskInventoryItems(remoteClient.AgentId, part.Name, part, invList);
257 break;
258 }
259
260 return true;
261 }
262 }
263} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index 2817477..d4166d0 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -588,8 +588,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
588 client.OnModifyTerrain += client_OnModifyTerrain; 588 client.OnModifyTerrain += client_OnModifyTerrain;
589 client.OnBakeTerrain += client_OnBakeTerrain; 589 client.OnBakeTerrain += client_OnBakeTerrain;
590 client.OnLandUndo += client_OnLandUndo; 590 client.OnLandUndo += client_OnLandUndo;
591 client.OnUnackedTerrain += client_OnUnackedTerrain;
591 } 592 }
592 593
593 /// <summary> 594 /// <summary>
594 /// Checks to see if the terrain has been modified since last check 595 /// Checks to see if the terrain has been modified since last check
595 /// but won't attempt to limit those changes to the limits specified in the estate settings 596 /// but won't attempt to limit those changes to the limits specified in the estate settings
@@ -810,6 +811,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain
810 InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter 811 InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter
811 } 812 }
812 } 813 }
814
815 protected void client_OnUnackedTerrain(IClientAPI client, int patchX, int patchY)
816 {
817 //m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY);
818 client.SendLayerData(patchX, patchY, m_scene.Heightmap.GetFloatsSerialised());
819 }
813 820
814 private void StoreUndoState() 821 private void StoreUndoState()
815 { 822 {
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index a1a4f9e..9f88517 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -138,14 +138,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
138 remoteClient.SendMapBlock(blocks, 2); 138 remoteClient.SendMapBlock(blocks, 2);
139 } 139 }
140 140
141 private Scene GetClientScene(IClientAPI client) 141// private Scene GetClientScene(IClientAPI client)
142 { 142// {
143 foreach (Scene s in m_scenes) 143// foreach (Scene s in m_scenes)
144 { 144// {
145 if (client.Scene.RegionInfo.RegionHandle == s.RegionInfo.RegionHandle) 145// if (client.Scene.RegionInfo.RegionHandle == s.RegionInfo.RegionHandle)
146 return s; 146// return s;
147 } 147// }
148 return m_scene; 148// return m_scene;
149 } 149// }
150 } 150 }
151} 151}
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 9d9967a..f036d85 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1000,11 +1000,24 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1000 return responsemap; 1000 return responsemap;
1001 } 1001 }
1002 1002
1003 public void RegenerateMaptile(byte[] data) 1003 public void GenerateMaptile()
1004 { 1004 {
1005 // Cannot create a map for a nonexistant heightmap
1006 if (m_scene.Heightmap == null)
1007 return;
1008
1009 //create a texture asset of the terrain
1010 IMapImageGenerator terrain = m_scene.RequestModuleInterface<IMapImageGenerator>();
1011 if (terrain == null)
1012 return;
1013
1014 byte[] data = terrain.WriteJpeg2000Image("defaultstripe.png");
1015 if (data == null)
1016 return;
1017
1005 UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID; 1018 UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID;
1006 1019
1007 m_log.Debug("[MAPTILE]: STORING MAPTILE IMAGE"); 1020 m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE");
1008 1021
1009 m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Random(); 1022 m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Random();
1010 1023
diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
index 00f6918..c489972 100644
--- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
+++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
@@ -135,7 +135,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
135 xmlobject.AppendChild(node); 135 xmlobject.AppendChild(node);
136 136
137 node = nodeFactory.CreateNode(XmlNodeType.Element, "flags", ""); 137 node = nodeFactory.CreateNode(XmlNodeType.Element, "flags", "");
138 node.InnerText = String.Format("{0:x}", m_rootPart.ObjectFlags); 138 node.InnerText = String.Format("{0:x}", (uint)m_rootPart.Flags);
139 xmlobject.AppendChild(node); 139 xmlobject.AppendChild(node);
140 140
141 node = nodeFactory.CreateNode(XmlNodeType.Element, "regionuuid", ""); 141 node = nodeFactory.CreateNode(XmlNodeType.Element, "regionuuid", "");
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index cdc56a2..944ad94 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -520,7 +520,11 @@ namespace OpenSim.Region.Examples.SimpleModule
520 { 520 {
521 } 521 }
522 522
523 public virtual void SendTeleportLocationStart() 523 public virtual void SendTeleportStart(uint flags)
524 {
525 }
526
527 public virtual void SendTeleportProgress(uint flags, string message)
524 { 528 {
525 } 529 }
526 530
diff --git a/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs b/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs
new file mode 100644
index 0000000..0132bae
--- /dev/null
+++ b/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs
@@ -0,0 +1,47 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using OpenMetaverse;
29using OpenSim.Framework;
30
31namespace OpenSim.Region.Framework.Interfaces
32{
33 public interface IBuySellModule
34 {
35 /// <summary>
36 /// Try to buy an object
37 /// </summary>
38 /// <param name="remoteClient"></param>
39 /// <param name="categoryID"></param>
40 /// <param name="localID"></param>
41 /// <param name="saleType"></param>
42 /// <returns>
43 /// True on a successful purchase, false on failure
44 /// </returns>
45 bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType);
46 }
47} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs
index f8a5bad..7296ac3 100644
--- a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs
@@ -25,7 +25,6 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28
29namespace OpenSim.Region.Framework.Interfaces 28namespace OpenSim.Region.Framework.Interfaces
30{ 29{
31 public interface ICloudModule : IRegionModule 30 public interface ICloudModule : IRegionModule
@@ -35,4 +34,4 @@ namespace OpenSim.Region.Framework.Interfaces
35 /// </summary> 34 /// </summary>
36 float CloudCover(int x, int y, int z); 35 float CloudCover(int x, int y, int z);
37 } 36 }
38} 37} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs
index 2390ff4..1e92fde 100644
--- a/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs
@@ -35,7 +35,6 @@ namespace OpenSim.Region.Framework.Interfaces
35 /// </summary> 35 /// </summary>
36 public interface IInventoryTransferModule 36 public interface IInventoryTransferModule
37 { 37 {
38 void SetRootAgentScene(UUID agentID, Scene scene);
39 bool NeedSceneCacheClear(UUID agentID, Scene scene); 38 bool NeedSceneCacheClear(UUID agentID, Scene scene);
40 } 39 }
41} 40} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
index ac6afed..d6e31f4 100644
--- a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
@@ -29,6 +29,9 @@ namespace OpenSim.Region.Framework.Interfaces
29{ 29{
30 public interface IWorldMapModule 30 public interface IWorldMapModule
31 { 31 {
32 void RegenerateMaptile(byte[] data); 32 /// <summary>
33 /// Generate a map tile for the scene. a terrain texture for this scene
34 /// </summary>
35 void GenerateMaptile();
33 } 36 }
34} 37}
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index c6db7af..145f9ed 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -197,9 +197,9 @@ namespace OpenSim.Region.Framework.Scenes
197 return 0.0; 197 return 0.0;
198 198
199 // Use group position for child prims 199 // Use group position for child prims
200 Vector3 entityPos = entity.AbsolutePosition; 200 Vector3 entityPos;
201 if (entity is SceneObjectPart) 201 if (entity is SceneObjectPart)
202 entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; 202 entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
203 else 203 else
204 entityPos = entity.AbsolutePosition; 204 entityPos = entity.AbsolutePosition;
205 205
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 17159b4..18ea865 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -687,7 +687,7 @@ namespace OpenSim.Region.Framework.Scenes
687 /// <summary> 687 /// <summary>
688 /// Create a new asset data structure. 688 /// Create a new asset data structure.
689 /// </summary> 689 /// </summary>
690 private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data, UUID creatorID) 690 public AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data, UUID creatorID)
691 { 691 {
692 AssetBase asset = new AssetBase(UUID.Random(), name, assetType, creatorID.ToString()); 692 AssetBase asset = new AssetBase(UUID.Random(), name, assetType, creatorID.ToString());
693 asset.Description = description; 693 asset.Description = description;
@@ -869,7 +869,7 @@ namespace OpenSim.Region.Framework.Scenes
869 ScenePresence presence; 869 ScenePresence presence;
870 if (TryGetScenePresence(remoteClient.AgentId, out presence)) 870 if (TryGetScenePresence(remoteClient.AgentId, out presence))
871 { 871 {
872 byte[] data = null; 872// byte[] data = null;
873 873
874 AssetBase asset = new AssetBase(); 874 AssetBase asset = new AssetBase();
875 asset.FullID = olditemID; 875 asset.FullID = olditemID;
@@ -877,8 +877,10 @@ namespace OpenSim.Region.Framework.Scenes
877 asset.Name = name; 877 asset.Name = name;
878 asset.Description = description; 878 asset.Description = description;
879 879
880 CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, name, 0, callbackID, asset, invType, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch()); 880 CreateNewInventoryItem(
881 881 remoteClient, remoteClient.AgentId.ToString(), folderID, name, 0, callbackID, asset, invType,
882 (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All,
883 (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch());
882 } 884 }
883 else 885 else
884 { 886 {
@@ -911,7 +913,6 @@ namespace OpenSim.Region.Framework.Scenes
911 InventoryService.DeleteFolders(remoteClient.AgentId, folderIDs); 913 InventoryService.DeleteFolders(remoteClient.AgentId, folderIDs);
912 } 914 }
913 915
914
915 /// <summary> 916 /// <summary>
916 /// Send the details of a prim's inventory to the client. 917 /// Send the details of a prim's inventory to the client.
917 /// </summary> 918 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 7c89e65..73472a9 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -496,73 +496,6 @@ namespace OpenSim.Region.Framework.Scenes
496 496
497 #endregion 497 #endregion
498 498
499 #region BinaryStats
500
501 public class StatLogger
502 {
503 public DateTime StartTime;
504 public string Path;
505 public System.IO.BinaryWriter Log;
506 }
507 static StatLogger m_statLog = null;
508 static TimeSpan m_statLogPeriod = TimeSpan.FromSeconds(300);
509 static string m_statsDir = String.Empty;
510 static Object m_statLockObject = new Object();
511 private void LogSimStats(SimStats stats)
512 {
513 SimStatsPacket pack = new SimStatsPacket();
514 pack.Region = new SimStatsPacket.RegionBlock();
515 pack.Region.RegionX = stats.RegionX;
516 pack.Region.RegionY = stats.RegionY;
517 pack.Region.RegionFlags = stats.RegionFlags;
518 pack.Region.ObjectCapacity = stats.ObjectCapacity;
519 //pack.Region = //stats.RegionBlock;
520 pack.Stat = stats.StatsBlock;
521 pack.Header.Reliable = false;
522
523 // note that we are inside the reporter lock when called
524 DateTime now = DateTime.Now;
525
526 // hide some time information into the packet
527 pack.Header.Sequence = (uint)now.Ticks;
528
529 lock (m_statLockObject) // m_statLog is shared so make sure there is only executer here
530 {
531 try
532 {
533 if (m_statLog == null || now > m_statLog.StartTime + m_statLogPeriod)
534 {
535 // First log file or time has expired, start writing to a new log file
536 if (m_statLog != null && m_statLog.Log != null)
537 {
538 m_statLog.Log.Close();
539 }
540 m_statLog = new StatLogger();
541 m_statLog.StartTime = now;
542 m_statLog.Path = (m_statsDir.Length > 0 ? m_statsDir + System.IO.Path.DirectorySeparatorChar.ToString() : "")
543 + String.Format("stats-{0}.log", now.ToString("yyyyMMddHHmmss"));
544 m_statLog.Log = new BinaryWriter(File.Open(m_statLog.Path, FileMode.Append, FileAccess.Write));
545 }
546
547 // Write the serialized data to disk
548 if (m_statLog != null && m_statLog.Log != null)
549 m_statLog.Log.Write(pack.ToBytes());
550 }
551 catch (Exception ex)
552 {
553 m_log.Error("statistics gathering failed: " + ex.Message, ex);
554 if (m_statLog != null && m_statLog.Log != null)
555 {
556 m_statLog.Log.Close();
557 }
558 m_statLog = null;
559 }
560 }
561 return;
562 }
563
564 #endregion
565
566 #region Constructors 499 #region Constructors
567 500
568 public Scene(RegionInfo regInfo, AgentCircuitManager authen, 501 public Scene(RegionInfo regInfo, AgentCircuitManager authen,
@@ -628,45 +561,6 @@ namespace OpenSim.Region.Framework.Scenes
628 if (m_storageManager.EstateDataStore != null) 561 if (m_storageManager.EstateDataStore != null)
629 { 562 {
630 m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); 563 m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false);
631 if (m_regInfo.EstateSettings.EstateID == 0) // No record at all
632 {
633 MainConsole.Instance.Output("Your region is not part of an estate.");
634 while (true)
635 {
636 string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() {"yes", "no"});
637 if (response == "no")
638 {
639 // Create a new estate
640 m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, true);
641
642 m_regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", m_regInfo.EstateSettings.EstateName);
643 m_regInfo.EstateSettings.Save();
644 break;
645 }
646 else
647 {
648 response = MainConsole.Instance.CmdPrompt("Estate name to join", "None");
649 if (response == "None")
650 continue;
651
652 List<int> estateIDs = m_storageManager.EstateDataStore.GetEstates(response);
653 if (estateIDs.Count < 1)
654 {
655 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again");
656 continue;
657 }
658
659 int estateID = estateIDs[0];
660
661 m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID);
662
663 if (m_storageManager.EstateDataStore.LinkRegion(m_regInfo.RegionID, estateID))
664 break;
665
666 MainConsole.Instance.Output("Joining the estate failed. Please try again.");
667 }
668 }
669 }
670 } 564 }
671 565
672 #endregion Region Settings 566 #endregion Region Settings
@@ -771,38 +665,6 @@ namespace OpenSim.Region.Framework.Scenes
771 665
772 m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); 666 m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
773 CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false); 667 CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false);
774
775 #region BinaryStats
776
777 try
778 {
779 IConfig statConfig = m_config.Configs["Statistics.Binary"];
780 if (statConfig.Contains("enabled") && statConfig.GetBoolean("enabled"))
781 {
782 if (statConfig.Contains("collect_region_stats"))
783 {
784 if (statConfig.GetBoolean("collect_region_stats"))
785 {
786 // if enabled, add us to the event. If not enabled, I won't get called
787 StatsReporter.OnSendStatsResult += LogSimStats;
788 }
789 }
790 if (statConfig.Contains("region_stats_period_seconds"))
791 {
792 m_statLogPeriod = TimeSpan.FromSeconds(statConfig.GetInt("region_stats_period_seconds"));
793 }
794 if (statConfig.Contains("stats_dir"))
795 {
796 m_statsDir = statConfig.GetString("stats_dir");
797 }
798 }
799 }
800 catch
801 {
802 // if it doesn't work, we don't collect anything
803 }
804
805 #endregion BinaryStats
806 } 668 }
807 catch 669 catch
808 { 670 {
@@ -1844,33 +1706,6 @@ namespace OpenSim.Region.Framework.Scenes
1844 1706
1845 } 1707 }
1846 1708
1847 /// <summary>
1848 /// Create a terrain texture for this scene
1849 /// </summary>
1850 public void CreateTerrainTexture()
1851 {
1852 //create a texture asset of the terrain
1853 IMapImageGenerator terrain = RequestModuleInterface<IMapImageGenerator>();
1854
1855 // Cannot create a map for a nonexistant heightmap yet.
1856 if (Heightmap == null)
1857 return;
1858
1859 if (terrain == null)
1860 return;
1861
1862 byte[] data = terrain.WriteJpeg2000Image("defaultstripe.png");
1863 if (data != null)
1864 {
1865 IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>();
1866
1867 if (mapModule != null)
1868 mapModule.RegenerateMaptile(data);
1869 else
1870 m_log.DebugFormat("[SCENE]: MapModule is null, can't save maptile");
1871 }
1872 }
1873
1874 #endregion 1709 #endregion
1875 1710
1876 #region Load Land 1711 #region Load Land
@@ -1929,7 +1764,7 @@ namespace OpenSim.Region.Framework.Scenes
1929 1764
1930 AddRestoredSceneObject(group, true, true); 1765 AddRestoredSceneObject(group, true, true);
1931 SceneObjectPart rootPart = group.GetChildPart(group.UUID); 1766 SceneObjectPart rootPart = group.GetChildPart(group.UUID);
1932 rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted; 1767 rootPart.Flags &= ~PrimFlags.Scripted;
1933 rootPart.TrimPermissions(); 1768 rootPart.TrimPermissions();
1934 group.CheckSculptAndLoad(); 1769 group.CheckSculptAndLoad();
1935 //rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); 1770 //rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
@@ -2248,7 +2083,7 @@ namespace OpenSim.Region.Framework.Scenes
2248 2083
2249 foreach (SceneObjectPart part in group.Children.Values) 2084 foreach (SceneObjectPart part in group.Children.Values)
2250 { 2085 {
2251 if (part.IsJoint() && ((part.ObjectFlags&(uint)PrimFlags.Physics) != 0)) 2086 if (part.IsJoint() && ((part.Flags & PrimFlags.Physics) != 0))
2252 { 2087 {
2253 PhysicsScene.RequestJointDeletion(part.Name); // FIXME: what if the name changed? 2088 PhysicsScene.RequestJointDeletion(part.Name); // FIXME: what if the name changed?
2254 } 2089 }
@@ -2761,7 +2596,7 @@ namespace OpenSim.Region.Framework.Scenes
2761 if (!VerifyClient(aCircuit, ep, out vialogin)) 2596 if (!VerifyClient(aCircuit, ep, out vialogin))
2762 { 2597 {
2763 // uh-oh, this is fishy 2598 // uh-oh, this is fishy
2764 m_log.WarnFormat("[Scene]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", 2599 m_log.WarnFormat("[SCENE]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.",
2765 client.AgentId, client.SessionId, ep.ToString()); 2600 client.AgentId, client.SessionId, ep.ToString());
2766 try 2601 try
2767 { 2602 {
@@ -2769,13 +2604,13 @@ namespace OpenSim.Region.Framework.Scenes
2769 } 2604 }
2770 catch (Exception e) 2605 catch (Exception e)
2771 { 2606 {
2772 m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace); 2607 m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace);
2773 } 2608 }
2774 return; 2609 return;
2775 } 2610 }
2776 } 2611 }
2777 2612
2778 m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); 2613 m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
2779 2614
2780 ScenePresence sp = CreateAndAddScenePresence(client); 2615 ScenePresence sp = CreateAndAddScenePresence(client);
2781 if (aCircuit != null) 2616 if (aCircuit != null)
@@ -2804,7 +2639,7 @@ namespace OpenSim.Region.Framework.Scenes
2804 // Do the verification here 2639 // Do the verification here
2805 if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) 2640 if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0)
2806 { 2641 {
2807 m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); 2642 m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2808 vialogin = true; 2643 vialogin = true;
2809 IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>(); 2644 IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
2810 if (userVerification != null && ep != null) 2645 if (userVerification != null && ep != null)
@@ -2814,11 +2649,11 @@ namespace OpenSim.Region.Framework.Scenes
2814 if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString())) 2649 if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString()))
2815 { 2650 {
2816 // uh-oh, this is fishy 2651 // uh-oh, this is fishy
2817 m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); 2652 m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2818 return false; 2653 return false;
2819 } 2654 }
2820 else 2655 else
2821 m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); 2656 m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2822 } 2657 }
2823 } 2658 }
2824 2659
@@ -2849,7 +2684,7 @@ namespace OpenSim.Region.Framework.Scenes
2849 } 2684 }
2850 catch (Exception e) 2685 catch (Exception e)
2851 { 2686 {
2852 m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace); 2687 m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace);
2853 } 2688 }
2854 } 2689 }
2855 else 2690 else
@@ -2879,7 +2714,6 @@ namespace OpenSim.Region.Framework.Scenes
2879 public virtual void SubscribeToClientTerrainEvents(IClientAPI client) 2714 public virtual void SubscribeToClientTerrainEvents(IClientAPI client)
2880 { 2715 {
2881 client.OnRegionHandShakeReply += SendLayerData; 2716 client.OnRegionHandShakeReply += SendLayerData;
2882 client.OnUnackedTerrain += TerrainUnAcked;
2883 } 2717 }
2884 2718
2885 public virtual void SubscribeToClientPrimEvents(IClientAPI client) 2719 public virtual void SubscribeToClientPrimEvents(IClientAPI client)
@@ -2919,8 +2753,7 @@ namespace OpenSim.Region.Framework.Scenes
2919 client.OnUndo += m_sceneGraph.HandleUndo; 2753 client.OnUndo += m_sceneGraph.HandleUndo;
2920 client.OnRedo += m_sceneGraph.HandleRedo; 2754 client.OnRedo += m_sceneGraph.HandleRedo;
2921 client.OnObjectDescription += m_sceneGraph.PrimDescription; 2755 client.OnObjectDescription += m_sceneGraph.PrimDescription;
2922 client.OnObjectDrop += m_sceneGraph.DropObject; 2756 client.OnObjectDrop += m_sceneGraph.DropObject;
2923 client.OnObjectSaleInfo += ObjectSaleInfo;
2924 client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable; 2757 client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable;
2925 client.OnObjectOwner += ObjectOwner; 2758 client.OnObjectOwner += ObjectOwner;
2926 } 2759 }
@@ -3011,7 +2844,6 @@ namespace OpenSim.Region.Framework.Scenes
3011 public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client) 2844 public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client)
3012 { 2845 {
3013 client.OnRegionHandShakeReply -= SendLayerData; 2846 client.OnRegionHandShakeReply -= SendLayerData;
3014 client.OnUnackedTerrain -= TerrainUnAcked;
3015 } 2847 }
3016 2848
3017 public virtual void UnSubscribeToClientPrimEvents(IClientAPI client) 2849 public virtual void UnSubscribeToClientPrimEvents(IClientAPI client)
@@ -3050,7 +2882,6 @@ namespace OpenSim.Region.Framework.Scenes
3050 client.OnRedo -= m_sceneGraph.HandleRedo; 2882 client.OnRedo -= m_sceneGraph.HandleRedo;
3051 client.OnObjectDescription -= m_sceneGraph.PrimDescription; 2883 client.OnObjectDescription -= m_sceneGraph.PrimDescription;
3052 client.OnObjectDrop -= m_sceneGraph.DropObject; 2884 client.OnObjectDrop -= m_sceneGraph.DropObject;
3053 client.OnObjectSaleInfo -= ObjectSaleInfo;
3054 client.OnObjectIncludeInSearch -= m_sceneGraph.MakeObjectSearchable; 2885 client.OnObjectIncludeInSearch -= m_sceneGraph.MakeObjectSearchable;
3055 client.OnObjectOwner -= ObjectOwner; 2886 client.OnObjectOwner -= ObjectOwner;
3056 } 2887 }
@@ -4625,23 +4456,6 @@ namespace OpenSim.Region.Framework.Scenes
4625 client.SendRegionHandle(regionID, handle); 4456 client.SendRegionHandle(regionID, handle);
4626 } 4457 }
4627 4458
4628 public void TerrainUnAcked(IClientAPI client, int patchX, int patchY)
4629 {
4630 //m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY);
4631 client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised());
4632 }
4633
4634 public void SetRootAgentScene(UUID agentID)
4635 {
4636 IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>();
4637 if (inv == null)
4638 return;
4639
4640 inv.SetRootAgentScene(agentID, this);
4641
4642 EventManager.TriggerSetRootAgentScene(agentID, this);
4643 }
4644
4645 public bool NeedSceneCacheClear(UUID agentID) 4459 public bool NeedSceneCacheClear(UUID agentID)
4646 { 4460 {
4647 IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>(); 4461 IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>();
@@ -4651,184 +4465,6 @@ namespace OpenSim.Region.Framework.Scenes
4651 return inv.NeedSceneCacheClear(agentID, this); 4465 return inv.NeedSceneCacheClear(agentID, this);
4652 } 4466 }
4653 4467
4654 public void ObjectSaleInfo(IClientAPI client, UUID agentID, UUID sessionID, uint localID, byte saleType, int salePrice)
4655 {
4656 SceneObjectPart part = GetSceneObjectPart(localID);
4657 if (part == null || part.ParentGroup == null)
4658 return;
4659
4660 if (part.ParentGroup.IsDeleted)
4661 return;
4662
4663 part = part.ParentGroup.RootPart;
4664
4665 part.ObjectSaleType = saleType;
4666 part.SalePrice = salePrice;
4667
4668 part.ParentGroup.HasGroupChanged = true;
4669
4670 part.GetProperties(client);
4671 }
4672
4673 public bool PerformObjectBuy(IClientAPI remoteClient, UUID categoryID,
4674 uint localID, byte saleType)
4675 {
4676 SceneObjectPart part = GetSceneObjectPart(localID);
4677
4678 if (part == null)
4679 return false;
4680
4681 if (part.ParentGroup == null)
4682 return false;
4683
4684 SceneObjectGroup group = part.ParentGroup;
4685
4686 switch (saleType)
4687 {
4688 case 1: // Sell as original (in-place sale)
4689 uint effectivePerms=group.GetEffectivePermissions();
4690
4691 if ((effectivePerms & (uint)PermissionMask.Transfer) == 0)
4692 {
4693 m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale");
4694 return false;
4695 }
4696
4697 group.SetOwnerId(remoteClient.AgentId);
4698 group.SetRootPartOwner(part, remoteClient.AgentId,
4699 remoteClient.ActiveGroupId);
4700
4701 List<SceneObjectPart> partList =
4702 new List<SceneObjectPart>(group.Children.Values);
4703
4704 if (Permissions.PropagatePermissions())
4705 {
4706 foreach (SceneObjectPart child in partList)
4707 {
4708 child.Inventory.ChangeInventoryOwner(remoteClient.AgentId);
4709 child.TriggerScriptChangedEvent(Changed.OWNER);
4710 child.ApplyNextOwnerPermissions();
4711 }
4712 }
4713
4714 part.ObjectSaleType = 0;
4715 part.SalePrice = 10;
4716
4717 group.HasGroupChanged = true;
4718 part.GetProperties(remoteClient);
4719 part.TriggerScriptChangedEvent(Changed.OWNER);
4720 group.ResumeScripts();
4721 part.ScheduleFullUpdate();
4722
4723 break;
4724
4725 case 2: // Sell a copy
4726
4727
4728 Vector3 inventoryStoredPosition = new Vector3
4729 (((group.AbsolutePosition.X > (int)Constants.RegionSize)
4730 ? 250
4731 : group.AbsolutePosition.X)
4732 ,
4733 (group.AbsolutePosition.X > (int)Constants.RegionSize)
4734 ? 250
4735 : group.AbsolutePosition.X,
4736 group.AbsolutePosition.Z);
4737
4738 Vector3 originalPosition = group.AbsolutePosition;
4739
4740 group.AbsolutePosition = inventoryStoredPosition;
4741
4742 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group);
4743 group.AbsolutePosition = originalPosition;
4744
4745 uint perms=group.GetEffectivePermissions();
4746
4747 if ((perms & (uint)PermissionMask.Transfer) == 0)
4748 {
4749 m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale");
4750 return false;
4751 }
4752
4753 AssetBase asset = CreateAsset(
4754 group.GetPartName(localID),
4755 group.GetPartDescription(localID),
4756 (sbyte)AssetType.Object,
4757 Utils.StringToBytes(sceneObjectXml),
4758 group.OwnerID);
4759 AssetService.Store(asset);
4760
4761 InventoryItemBase item = new InventoryItemBase();
4762 item.CreatorId = part.CreatorID.ToString();
4763
4764 item.ID = UUID.Random();
4765 item.Owner = remoteClient.AgentId;
4766 item.AssetID = asset.FullID;
4767 item.Description = asset.Description;
4768 item.Name = asset.Name;
4769 item.AssetType = asset.Type;
4770 item.InvType = (int)InventoryType.Object;
4771 item.Folder = categoryID;
4772
4773 uint nextPerms=(perms & 7) << 13;
4774 if ((nextPerms & (uint)PermissionMask.Copy) == 0)
4775 perms &= ~(uint)PermissionMask.Copy;
4776 if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
4777 perms &= ~(uint)PermissionMask.Transfer;
4778 if ((nextPerms & (uint)PermissionMask.Modify) == 0)
4779 perms &= ~(uint)PermissionMask.Modify;
4780
4781 item.BasePermissions = perms & part.NextOwnerMask;
4782 item.CurrentPermissions = perms & part.NextOwnerMask;
4783 item.NextPermissions = part.NextOwnerMask;
4784 item.EveryOnePermissions = part.EveryoneMask &
4785 part.NextOwnerMask;
4786 item.GroupPermissions = part.GroupMask &
4787 part.NextOwnerMask;
4788 item.CurrentPermissions |= 16; // Slam!
4789 item.CreationDate = Util.UnixTimeSinceEpoch();
4790
4791 if (InventoryService.AddItem(item))
4792 remoteClient.SendInventoryItemCreateUpdate(item, 0);
4793 else
4794 {
4795 m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable");
4796 return false;
4797 }
4798 break;
4799
4800 case 3: // Sell contents
4801 List<UUID> invList = part.Inventory.GetInventoryList();
4802
4803 bool okToSell = true;
4804
4805 foreach (UUID invID in invList)
4806 {
4807 TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID);
4808 if ((item1.CurrentPermissions &
4809 (uint)PermissionMask.Transfer) == 0)
4810 {
4811 okToSell = false;
4812 break;
4813 }
4814 }
4815
4816 if (!okToSell)
4817 {
4818 m_dialogModule.SendAlertToUser(
4819 remoteClient, "This item's inventory doesn't appear to be for sale");
4820 return false;
4821 }
4822
4823 if (invList.Count > 0)
4824 MoveTaskInventoryItems(remoteClient.AgentId, part.Name,
4825 part, invList);
4826 break;
4827 }
4828
4829 return true;
4830 }
4831
4832 public void CleanTempObjects() 4468 public void CleanTempObjects()
4833 { 4469 {
4834 List<EntityBase> objs = GetEntities(); 4470 List<EntityBase> objs = GetEntities();
@@ -4969,7 +4605,7 @@ namespace OpenSim.Region.Framework.Scenes
4969 } 4605 }
4970 4606
4971 // turn the proxy non-physical, which also stops its client-side interpolation 4607 // turn the proxy non-physical, which also stops its client-side interpolation
4972 bool wasUsingPhysics = ((jointProxyObject.ObjectFlags & (uint)PrimFlags.Physics) != 0); 4608 bool wasUsingPhysics = ((jointProxyObject.Flags & PrimFlags.Physics) != 0);
4973 if (wasUsingPhysics) 4609 if (wasUsingPhysics)
4974 { 4610 {
4975 jointProxyObject.UpdatePrimFlags(false, false, true, false); // FIXME: possible deadlock here; check to make sure all the scene alterations set into motion here won't deadlock 4611 jointProxyObject.UpdatePrimFlags(false, false, true, false); // FIXME: possible deadlock here; check to make sure all the scene alterations set into motion here won't deadlock
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 20a2abc..9b66fad 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1588,9 +1588,9 @@ namespace OpenSim.Region.Framework.Scenes
1588 1588
1589 public void aggregateScriptEvents() 1589 public void aggregateScriptEvents()
1590 { 1590 {
1591 uint objectflagupdate=(uint)RootPart.GetEffectiveObjectFlags(); 1591 PrimFlags objectflagupdate = (PrimFlags)RootPart.GetEffectiveObjectFlags();
1592 1592
1593 scriptEvents aggregateScriptEvents=0; 1593 scriptEvents aggregateScriptEvents = 0;
1594 1594
1595 lockPartsForRead(true); 1595 lockPartsForRead(true);
1596 { 1596 {
@@ -1600,7 +1600,7 @@ namespace OpenSim.Region.Framework.Scenes
1600 if (part == null) 1600 if (part == null)
1601 continue; 1601 continue;
1602 if (part != RootPart) 1602 if (part != RootPart)
1603 part.ObjectFlags = objectflagupdate; 1603 part.Flags = objectflagupdate;
1604 aggregateScriptEvents |= part.AggregateScriptEvents; 1604 aggregateScriptEvents |= part.AggregateScriptEvents;
1605 1605
1606 } 1606 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index dd780b7..9e52b00 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1348,7 +1348,7 @@ namespace OpenSim.Region.Framework.Scenes
1348 public void AddFlag(PrimFlags flag) 1348 public void AddFlag(PrimFlags flag)
1349 { 1349 {
1350 // PrimFlags prevflag = Flags; 1350 // PrimFlags prevflag = Flags;
1351 if ((ObjectFlags & (uint) flag) == 0) 1351 if ((Flags & flag) == 0)
1352 { 1352 {
1353 //m_log.Debug("Adding flag: " + ((PrimFlags) flag).ToString()); 1353 //m_log.Debug("Adding flag: " + ((PrimFlags) flag).ToString());
1354 Flags |= flag; 1354 Flags |= flag;
@@ -1638,7 +1638,7 @@ namespace OpenSim.Region.Framework.Scenes
1638 dupe.Velocity = new Vector3(0, 0, 0); 1638 dupe.Velocity = new Vector3(0, 0, 0);
1639 dupe.Acceleration = new Vector3(0, 0, 0); 1639 dupe.Acceleration = new Vector3(0, 0, 0);
1640 dupe.AngularVelocity = new Vector3(0, 0, 0); 1640 dupe.AngularVelocity = new Vector3(0, 0, 0);
1641 dupe.ObjectFlags = ObjectFlags; 1641 dupe.Flags = Flags;
1642 1642
1643 dupe._ownershipCost = _ownershipCost; 1643 dupe._ownershipCost = _ownershipCost;
1644 dupe._objectSaleType = _objectSaleType; 1644 dupe._objectSaleType = _objectSaleType;
@@ -1675,7 +1675,7 @@ namespace OpenSim.Region.Framework.Scenes
1675 m_parentGroup.Scene.AssetService.Get(dupe.m_shape.SculptTexture.ToString(), dupe, AssetReceived); 1675 m_parentGroup.Scene.AssetService.Get(dupe.m_shape.SculptTexture.ToString(), dupe, AssetReceived);
1676 } 1676 }
1677 1677
1678 bool UsePhysics = ((dupe.ObjectFlags & (uint)PrimFlags.Physics) != 0); 1678 bool UsePhysics = ((dupe.Flags & PrimFlags.Physics) != 0);
1679 dupe.DoPhysicsPropertyUpdate(UsePhysics, true); 1679 dupe.DoPhysicsPropertyUpdate(UsePhysics, true);
1680 } 1680 }
1681 1681
@@ -4299,9 +4299,9 @@ namespace OpenSim.Region.Framework.Scenes
4299 4299
4300 public void UpdatePrimFlags(bool UsePhysics, bool IsTemporary, bool IsPhantom, bool IsVD) 4300 public void UpdatePrimFlags(bool UsePhysics, bool IsTemporary, bool IsPhantom, bool IsVD)
4301 { 4301 {
4302 bool wasUsingPhysics = ((ObjectFlags & (uint) PrimFlags.Physics) != 0); 4302 bool wasUsingPhysics = ((Flags & PrimFlags.Physics) != 0);
4303 bool wasTemporary = ((ObjectFlags & (uint)PrimFlags.TemporaryOnRez) != 0); 4303 bool wasTemporary = ((Flags & PrimFlags.TemporaryOnRez) != 0);
4304 bool wasPhantom = ((ObjectFlags & (uint)PrimFlags.Phantom) != 0); 4304 bool wasPhantom = ((Flags & PrimFlags.Phantom) != 0);
4305 bool wasVD = VolumeDetectActive; 4305 bool wasVD = VolumeDetectActive;
4306 4306
4307 if ((UsePhysics == wasUsingPhysics) && (wasTemporary == IsTemporary) && (wasPhantom == IsPhantom) && (IsVD==wasVD)) 4307 if ((UsePhysics == wasUsingPhysics) && (wasTemporary == IsTemporary) && (wasPhantom == IsPhantom) && (IsVD==wasVD))
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 4064339..02e60f8 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -905,7 +905,8 @@ namespace OpenSim.Region.Framework.Scenes
905 m_grouptitle = gm.GetGroupTitle(m_uuid); 905 m_grouptitle = gm.GetGroupTitle(m_uuid);
906 906
907 m_rootRegionHandle = m_scene.RegionInfo.RegionHandle; 907 m_rootRegionHandle = m_scene.RegionInfo.RegionHandle;
908 m_scene.SetRootAgentScene(m_uuid); 908
909 m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene);
909 910
910 // Moved this from SendInitialData to ensure that m_appearance is initialized 911 // Moved this from SendInitialData to ensure that m_appearance is initialized
911 // before the inventory is processed in MakeRootAgent. This fixes a race condition 912 // before the inventory is processed in MakeRootAgent. This fixes a race condition
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 91cbee9..b98aabe 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1045,11 +1045,15 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1045 1045
1046 } 1046 }
1047 1047
1048 public void SendTeleportLocationStart() 1048 public void SendTeleportStart(uint flags)
1049 { 1049 {
1050 1050
1051 } 1051 }
1052 1052
1053 public void SendTeleportProgress(uint flags, string message)
1054 {
1055 }
1056
1053 public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) 1057 public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance)
1054 { 1058 {
1055 1059
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index 3f15b69..2969503 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -1129,7 +1129,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1129 OSDMap NewGroupDataMap = new OSDMap(1); 1129 OSDMap NewGroupDataMap = new OSDMap(1);
1130 1130
1131 GroupDataMap.Add("GroupID", OSD.FromUUID(membership.GroupID)); 1131 GroupDataMap.Add("GroupID", OSD.FromUUID(membership.GroupID));
1132 GroupDataMap.Add("GroupPowers", OSD.FromBinary(membership.GroupPowers)); 1132 GroupDataMap.Add("GroupPowers", OSD.FromULong(membership.GroupPowers));
1133 GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(membership.AcceptNotices)); 1133 GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(membership.AcceptNotices));
1134 GroupDataMap.Add("GroupInsigniaID", OSD.FromUUID(membership.GroupPicture)); 1134 GroupDataMap.Add("GroupInsigniaID", OSD.FromUUID(membership.GroupPicture));
1135 GroupDataMap.Add("Contribution", OSD.FromInteger(membership.Contribution)); 1135 GroupDataMap.Add("Contribution", OSD.FromInteger(membership.Contribution));
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
index 653f856..61cbb90 100644
--- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
+++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
@@ -72,8 +72,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
72 72
73 private IConfigSource m_gConfig; 73 private IConfigSource m_gConfig;
74 74
75
76
77 /// <summary> 75 /// <summary>
78 /// Region UUIDS indexed by AgentID 76 /// Region UUIDS indexed by AgentID
79 /// </summary> 77 /// </summary>
@@ -85,7 +83,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
85 83
86 // private int m_stipend = 1000; 84 // private int m_stipend = 1000;
87 85
88 private int ObjectCapacity = 45000; 86// private int ObjectCapacity = 45000;
89 private int ObjectCount = 0; 87 private int ObjectCount = 0;
90 private int PriceEnergyUnit = 0; 88 private int PriceEnergyUnit = 0;
91 private int PriceGroupCreate = 0; 89 private int PriceGroupCreate = 0;
@@ -267,13 +265,11 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
267 PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1); 265 PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1);
268 m_sellEnabled = startupConfig.GetBoolean("SellEnabled", false); 266 m_sellEnabled = startupConfig.GetBoolean("SellEnabled", false);
269 } 267 }
270
271 } 268 }
272 269
273 private void GetClientFunds(IClientAPI client) 270 private void GetClientFunds(IClientAPI client)
274 { 271 {
275 CheckExistAndRefreshFunds(client.AgentId); 272 CheckExistAndRefreshFunds(client.AgentId);
276
277 } 273 }
278 274
279 /// <summary> 275 /// <summary>
@@ -815,7 +811,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
815 remoteClient.SendAgentAlertMessage("Unable to buy now. The object was not found.", false); 811 remoteClient.SendAgentAlertMessage("Unable to buy now. The object was not found.", false);
816 return; 812 return;
817 } 813 }
818 s.PerformObjectBuy(remoteClient, categoryID, localID, saleType); 814
815 IBuySellModule module = s.RequestModuleInterface<IBuySellModule>();
816 if (module != null)
817 module.BuyObject(remoteClient, categoryID, localID, saleType);
819 } 818 }
820 } 819 }
821 820
@@ -825,7 +824,5 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
825 RegionMoneyRequest = 1, 824 RegionMoneyRequest = 1,
826 Gift = 2, 825 Gift = 2,
827 Purchase = 3 826 Purchase = 3
828 } 827 }
829 828} \ No newline at end of file
830
831}
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index d6f4d53..1653ecb 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -611,7 +611,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
611 { 611 {
612 } 612 }
613 613
614 public virtual void SendTeleportLocationStart() 614 public virtual void SendTeleportStart(uint flags)
615 {
616 }
617
618 public virtual void SendTeleportProgress(uint flags, string message)
615 { 619 {
616 } 620 }
617 621
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 9bece31..e3a69a8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4405,7 +4405,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4405 if (m_host.OwnerID == World.LandChannel.GetLandObject( 4405 if (m_host.OwnerID == World.LandChannel.GetLandObject(
4406 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 4406 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
4407 { 4407 {
4408 presence.ControllingClient.SendTeleportLocationStart();
4409 World.TeleportClientHome(agentId, presence.ControllingClient); 4408 World.TeleportClientHome(agentId, presence.ControllingClient);
4410 } 4409 }
4411 } 4410 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 73e87b5..a08b135 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -673,7 +673,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
673 regionName = regInfo.RegionName; 673 regionName = regInfo.RegionName;
674 } 674 }
675 } 675 }
676 presence.ControllingClient.SendTeleportLocationStart();
677 World.RequestTeleportLocation(presence.ControllingClient, regionName, 676 World.RequestTeleportLocation(presence.ControllingClient, regionName,
678 new Vector3((float)position.x, (float)position.y, (float)position.z), 677 new Vector3((float)position.x, (float)position.y, (float)position.z),
679 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); 678 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation);
@@ -705,7 +704,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
705 == World.LandChannel.GetLandObject( 704 == World.LandChannel.GetLandObject(
706 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 705 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
707 { 706 {
708 presence.ControllingClient.SendTeleportLocationStart();
709 World.RequestTeleportLocation(presence.ControllingClient, regionHandle, 707 World.RequestTeleportLocation(presence.ControllingClient, regionHandle,
710 new Vector3((float)position.x, (float)position.y, (float)position.z), 708 new Vector3((float)position.x, (float)position.y, (float)position.z),
711 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); 709 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation);
diff --git a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
index d1233dc..cdab49e 100644
--- a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
+++ b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
@@ -102,16 +102,15 @@ namespace OpenSim.Server.Handlers.Grid
102 } 102 }
103 catch (Exception) 103 catch (Exception)
104 { 104 {
105 _log.Debug("[GRID INFO SERVICE]: Cannot get grid info from config source, using minimal defaults"); 105 _log.Warn("[GRID INFO SERVICE]: Cannot get grid info from config source, using minimal defaults");
106 } 106 }
107 107
108 _log.DebugFormat("[GRID INFO SERVICE]: Grid info service initialized with {0} keys", _info.Count); 108 _log.DebugFormat("[GRID INFO SERVICE]: Grid info service initialized with {0} keys", _info.Count);
109
110 } 109 }
111 110
112 private void IssueWarning() 111 private void IssueWarning()
113 { 112 {
114 _log.Warn("[GRID INFO SERVICE]: found no [GridInfo] section in your OpenSim.ini"); 113 _log.Warn("[GRID INFO SERVICE]: found no [GridInfo] section in your configuration files");
115 _log.Warn("[GRID INFO SERVICE]: trying to guess sensible defaults, you might want to provide better ones:"); 114 _log.Warn("[GRID INFO SERVICE]: trying to guess sensible defaults, you might want to provide better ones:");
116 115
117 foreach (string k in _info.Keys) 116 foreach (string k in _info.Keys)
@@ -125,7 +124,7 @@ namespace OpenSim.Server.Handlers.Grid
125 XmlRpcResponse response = new XmlRpcResponse(); 124 XmlRpcResponse response = new XmlRpcResponse();
126 Hashtable responseData = new Hashtable(); 125 Hashtable responseData = new Hashtable();
127 126
128 _log.Info("[GRID INFO SERVICE]: Request for grid info"); 127 _log.Debug("[GRID INFO SERVICE]: Request for grid info");
129 128
130 foreach (string k in _info.Keys) 129 foreach (string k in _info.Keys)
131 { 130 {
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 96d2605..69dff3c 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -53,9 +53,20 @@ namespace OpenSim.Services.Connectors.Hypergrid
53 MethodBase.GetCurrentMethod().DeclaringType); 53 MethodBase.GetCurrentMethod().DeclaringType);
54 54
55 string m_ServerURL; 55 string m_ServerURL;
56 Uri m_Uri;
56 public UserAgentServiceConnector(string url) 57 public UserAgentServiceConnector(string url)
57 { 58 {
58 m_ServerURL = url; 59 m_ServerURL = url;
60 try
61 {
62 m_Uri = new Uri(m_ServerURL);
63 IPAddress ip = Util.GetHostFromDNS(m_Uri.Host);
64 m_ServerURL = "http://" + ip.ToString() + ":" + m_Uri.Port;
65 }
66 catch (Exception e)
67 {
68 m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", m_ServerURL, e.Message);
69 }
59 } 70 }
60 71
61 public UserAgentServiceConnector(IConfigSource config) 72 public UserAgentServiceConnector(IConfigSource config)
@@ -373,7 +384,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
373 384
374 if (response.IsFault) 385 if (response.IsFault)
375 { 386 {
376 m_log.ErrorFormat("[HGrid]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString); 387 m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
377 reason = "XMLRPC Fault"; 388 reason = "XMLRPC Fault";
378 return false; 389 return false;
379 } 390 }
@@ -403,7 +414,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
403 } 414 }
404 catch (Exception e) 415 catch (Exception e)
405 { 416 {
406 m_log.ErrorFormat("[HGrid]: Got exception on GetBoolResponse response."); 417 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetBoolResponse response.");
407 if (hash.ContainsKey("result") && hash["result"] != null) 418 if (hash.ContainsKey("result") && hash["result"] != null)
408 m_log.ErrorFormat("Reply was ", (string)hash["result"]); 419 m_log.ErrorFormat("Reply was ", (string)hash["result"]);
409 reason = "Exception: " + e.Message; 420 reason = "Exception: " + e.Message;
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
index 7a420e4..616b5a7 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
@@ -184,7 +184,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
184 } 184 }
185 catch (Exception ex) 185 catch (Exception ex)
186 { 186 {
187 m_log.Warn("[SIMIAN ASSET CONNECTOR]: Asset GET from " + url + " failed: " + ex.Message); 187 m_log.Warn("[SIMIAN ASSET CONNECTOR]: Asset HEAD from " + url + " failed: " + ex.Message);
188 } 188 }
189 189
190 return metadata; 190 return metadata;
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
index 704790e..d30d880 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
@@ -326,7 +326,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
326 try 326 try
327 { 327 {
328 interests = OSDParser.DeserializeJson(user["LLInterests"].AsString()) as OSDMap; 328 interests = OSDParser.DeserializeJson(user["LLInterests"].AsString()) as OSDMap;
329 client.SendAvatarInterestsReply(avatarID, interests["WantMask"].AsUInteger(), interests["WantText"].AsString(), interests["SkillsMask"].AsUInteger(), interests["SkillsText"].AsString(), interests["languages"].AsString()); 329 client.SendAvatarInterestsReply(avatarID, interests["WantMask"].AsUInteger(), interests["WantText"].AsString(), interests["SkillsMask"].AsUInteger(), interests["SkillsText"].AsString(), interests["Languages"].AsString());
330 } 330 }
331 catch { } 331 catch { }
332 } 332 }
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 0947b5f..957df35 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -257,7 +257,7 @@ namespace OpenSim.Services.Connectors.Simulation
257 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); 257 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
258 ChildUpdateRequest.Method = "PUT"; 258 ChildUpdateRequest.Method = "PUT";
259 ChildUpdateRequest.ContentType = "application/json"; 259 ChildUpdateRequest.ContentType = "application/json";
260 ChildUpdateRequest.Timeout = 10000; 260 ChildUpdateRequest.Timeout = 30000;
261 //ChildUpdateRequest.KeepAlive = false; 261 //ChildUpdateRequest.KeepAlive = false;
262 262
263 // Fill it in 263 // Fill it in
@@ -334,7 +334,7 @@ namespace OpenSim.Services.Connectors.Simulation
334 } 334 }
335 catch (WebException ex) 335 catch (WebException ex)
336 { 336 {
337 m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ChilAgentUpdate {0}", ex.Message); 337 m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ChilAgentUpdate from {0}: {1}", uri, ex.Message);
338 // ignore, really 338 // ignore, really
339 } 339 }
340 finally 340 finally
diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
index 38c191a..67c482b 100644
--- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
@@ -113,7 +113,7 @@ namespace OpenSim.Services.Connectors
113 113
114 public virtual UserAccount GetUserAccount(UUID scopeID, UUID userID) 114 public virtual UserAccount GetUserAccount(UUID scopeID, UUID userID)
115 { 115 {
116 m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUserAccount {0}", userID); 116 // m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUserAccount {0}", userID);
117 Dictionary<string, object> sendData = new Dictionary<string, object>(); 117 Dictionary<string, object> sendData = new Dictionary<string, object>();
118 //sendData["SCOPEID"] = scopeID.ToString(); 118 //sendData["SCOPEID"] = scopeID.ToString();
119 sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); 119 sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 3aaafe8..6f041da 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -259,7 +259,16 @@ namespace OpenSim.Services.HypergridService
259 if (account == null && !aCircuit.lastname.StartsWith("@")) 259 if (account == null && !aCircuit.lastname.StartsWith("@"))
260 { 260 {
261 aCircuit.firstname = aCircuit.firstname + "." + aCircuit.lastname; 261 aCircuit.firstname = aCircuit.firstname + "." + aCircuit.lastname;
262 aCircuit.lastname = "@" + aCircuit.ServiceURLs["HomeURI"].ToString(); 262 try
263 {
264 Uri uri = new Uri(aCircuit.ServiceURLs["HomeURI"].ToString());
265 aCircuit.lastname = "@" + uri.Host; // + ":" + uri.Port;
266 }
267 catch
268 {
269 m_log.WarnFormat("[GATEKEEPER SERVICE]: Malformed HomeURI (this should never happen): {0}", aCircuit.ServiceURLs["HomeURI"]);
270 aCircuit.lastname = "@" + aCircuit.ServiceURLs["HomeURI"].ToString();
271 }
263 } 272 }
264 273
265 // 274 //
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 1e4bc2a..1c860a7 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -614,7 +614,11 @@ namespace OpenSim.Tests.Common.Mock
614 { 614 {
615 } 615 }
616 616
617 public virtual void SendTeleportLocationStart() 617 public virtual void SendTeleportStart(uint flags)
618 {
619 }
620
621 public void SendTeleportProgress(uint flags, string message)
618 { 622 {
619 } 623 }
620 624
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs
index fecb73f..7c4f689 100644
--- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs
+++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common.Mock
42 /// </summary> 42 /// </summary>
43 public class TestInventoryDataPlugin : IInventoryDataPlugin 43 public class TestInventoryDataPlugin : IInventoryDataPlugin
44 { 44 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 /// <value> 47 /// <value>
48 /// Inventory folders 48 /// Inventory folders
diff --git a/OpenSim/Tests/ConfigurationLoaderTest.cs b/OpenSim/Tests/ConfigurationLoaderTest.cs
new file mode 100644
index 0000000..4262c95
--- /dev/null
+++ b/OpenSim/Tests/ConfigurationLoaderTest.cs
@@ -0,0 +1,143 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.IO;
29using Nini.Config;
30using NUnit.Framework;
31using OpenSim.Framework;
32
33namespace OpenSim.Tests
34{
35 [TestFixture]
36 public class ConfigurationLoaderTests
37 {
38 private const string m_testSubdirectory = "test";
39 private string m_basePath;
40 private string m_workingDirectory;
41 private IConfigSource m_config;
42
43 /// <summary>
44 /// Set up a test directory.
45 /// </summary>
46 [SetUp]
47 public void SetUp()
48 {
49 m_basePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
50 string path = Path.Combine(m_basePath, m_testSubdirectory);
51 Directory.CreateDirectory(path);
52 m_workingDirectory = Directory.GetCurrentDirectory();
53 Directory.SetCurrentDirectory(path);
54 }
55
56 /// <summary>
57 /// Remove the test directory.
58 /// </summary>
59 [TearDown]
60 public void TearDown()
61 {
62 Directory.SetCurrentDirectory(m_workingDirectory);
63 Directory.Delete(m_basePath, true);
64 }
65
66 /// <summary>
67 /// Test the including of ini files with absolute and relative paths.
68 /// </summary>
69 [Test]
70 public void IncludeTests()
71 {
72 const string mainIniFile = "OpenSim.ini";
73 m_config = new IniConfigSource();
74
75 // Create ini files in a directory structure
76 IniConfigSource ini;
77 IConfig config;
78
79 ini = new IniConfigSource();
80 config = ini.AddConfig("IncludeTest");
81 config.Set("Include-absolute", "absolute/*/config/*.ini");
82 config.Set("Include-relative", "../" + m_testSubdirectory + "/relative/*/config/*.ini");
83 CreateIni(mainIniFile, ini);
84
85 ini = new IniConfigSource();
86 ini.AddConfig("Absolute1").Set("name1", "value1");
87 CreateIni("absolute/one/config/setting.ini", ini);
88
89 ini = new IniConfigSource();
90 ini.AddConfig("Absolute2").Set("name2", 2.3);
91 CreateIni("absolute/two/config/setting1.ini", ini);
92
93 ini = new IniConfigSource();
94 ini.AddConfig("Absolute2").Set("name3", "value3");
95 CreateIni("absolute/two/config/setting2.ini", ini);
96
97 ini = new IniConfigSource();
98 ini.AddConfig("Relative1").Set("name4", "value4");
99 CreateIni("relative/one/config/setting.ini", ini);
100
101 ini = new IniConfigSource();
102 ini.AddConfig("Relative2").Set("name5", true);
103 CreateIni("relative/two/config/setting1.ini", ini);
104
105 ini = new IniConfigSource();
106 ini.AddConfig("Relative2").Set("name6", 6);
107 CreateIni("relative/two/config/setting2.ini", ini);
108
109 // Prepare call to ConfigurationLoader.LoadConfigSettings()
110 ConfigurationLoader cl = new ConfigurationLoader();
111 IConfigSource argvSource = new IniConfigSource();
112 argvSource.AddConfig("Startup").Set("inifile", mainIniFile);
113 ConfigSettings configSettings;
114 NetworkServersInfo networkInfo;
115
116 OpenSimConfigSource source = cl.LoadConfigSettings(argvSource, out configSettings, out networkInfo);
117
118 // Remove default config
119 config = source.Source.Configs["Startup"];
120 source.Source.Configs.Remove(config);
121 config = source.Source.Configs["Network"];
122 source.Source.Configs.Remove(config);
123
124 // Finally, we are able to check the result
125 Assert.AreEqual(m_config.ToString(), source.Source.ToString(),
126 "Configuration with includes does not contain all settings.");
127 // The following would be preferable but fails due to a type mismatch which I am not able to resolve
128 //CollectionAssert.AreEquivalent(m_config.Configs, source.Source.Configs,
129 // String.Format("Configuration with includes does not contain all settings.\nAll settings:\n{0}\nSettings read:\n{1}", m_config, source.Source));
130 }
131
132 private void CreateIni(string filepath, IniConfigSource source)
133 {
134 string path = Path.GetDirectoryName(filepath);
135 if (path != string.Empty)
136 {
137 Directory.CreateDirectory(path);
138 }
139 source.Save(filepath);
140 m_config.Merge(source);
141 }
142 }
143}
diff --git a/OpenSim/Tools/Configger/ConfigurationLoader.cs b/OpenSim/Tools/Configger/ConfigurationLoader.cs
index e74debb..8e71b42 100644
--- a/OpenSim/Tools/Configger/ConfigurationLoader.cs
+++ b/OpenSim/Tools/Configger/ConfigurationLoader.cs
@@ -141,7 +141,17 @@ namespace OpenSim.Tools.Configger
141 else 141 else
142 { 142 {
143 string basepath = Path.GetFullPath("."); 143 string basepath = Path.GetFullPath(".");
144 string path = Path.Combine(basepath, file); 144 // Resolve relative paths with wildcards
145 string chunkWithoutWildcards = file;
146 string chunkWithWildcards = string.Empty;
147 int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' });
148 if (wildcardIndex != -1)
149 {
150 chunkWithoutWildcards = file.Substring(0, wildcardIndex);
151 chunkWithWildcards = file.Substring(wildcardIndex);
152 }
153 string path = Path.Combine(basepath, chunkWithoutWildcards);
154 path = Path.GetFullPath(path) + chunkWithWildcards;
145 string[] paths = Util.Glob(path); 155 string[] paths = Util.Glob(path);
146 foreach (string p in paths) 156 foreach (string p in paths)
147 { 157 {