diff options
author | BlueWall | 2013-03-05 15:30:54 -0500 |
---|---|---|
committer | BlueWall | 2013-03-05 15:30:54 -0500 |
commit | f676408e2a45101bcab0a33f598ea9047f02036a (patch) | |
tree | eb34ea8fb0a783ee466873462285eba629ab6405 /OpenSim/Region | |
parent | Add method to remove JsonRpc Handlers from the server (diff) | |
parent | * Add a Max Payload size property to the Websocket Server Handler. If you ... (diff) | |
download | opensim-SC_OLD-f676408e2a45101bcab0a33f598ea9047f02036a.zip opensim-SC_OLD-f676408e2a45101bcab0a33f598ea9047f02036a.tar.gz opensim-SC_OLD-f676408e2a45101bcab0a33f598ea9047f02036a.tar.bz2 opensim-SC_OLD-f676408e2a45101bcab0a33f598ea9047f02036a.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
20 files changed, 449 insertions, 100 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index c555915..137bd81 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -134,6 +134,10 @@ namespace OpenSim | |||
134 | /// <param name="configSource"></param> | 134 | /// <param name="configSource"></param> |
135 | public OpenSimBase(IConfigSource configSource) : base() | 135 | public OpenSimBase(IConfigSource configSource) : base() |
136 | { | 136 | { |
137 | // FIXME: This should be done down in ServerBase but we need to sort out and refactor the log4net | ||
138 | // XmlConfigurator calls first accross servers. | ||
139 | m_log.InfoFormat("[SERVER BASE]: Starting in {0}", m_startupDirectory); | ||
140 | |||
137 | LoadConfigSettings(configSource); | 141 | LoadConfigSettings(configSource); |
138 | } | 142 | } |
139 | 143 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs index 33b1f77..45d33cd 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs | |||
@@ -57,7 +57,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
57 | public bool Enabled { get; private set; } | 57 | public bool Enabled { get; private set; } |
58 | 58 | ||
59 | private Scene m_scene; | 59 | private Scene m_scene; |
60 | private UUID m_agentID; | ||
61 | 60 | ||
62 | #region ISharedRegionModule Members | 61 | #region ISharedRegionModule Members |
63 | 62 | ||
@@ -118,25 +117,26 @@ namespace OpenSim.Region.ClientStack.Linden | |||
118 | public void RegisterCaps(UUID agentID, Caps caps) | 117 | public void RegisterCaps(UUID agentID, Caps caps) |
119 | { | 118 | { |
120 | IRequestHandler reqHandler | 119 | IRequestHandler reqHandler |
121 | = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), MeshUploadFlag, "MeshUploadFlag", agentID.ToString()); | 120 | = new RestHTTPHandler( |
121 | "GET", "/CAPS/" + UUID.Random(), ht => MeshUploadFlag(ht, agentID), "MeshUploadFlag", agentID.ToString()); | ||
122 | 122 | ||
123 | caps.RegisterHandler("MeshUploadFlag", reqHandler); | 123 | caps.RegisterHandler("MeshUploadFlag", reqHandler); |
124 | m_agentID = agentID; | 124 | |
125 | } | 125 | } |
126 | 126 | ||
127 | private Hashtable MeshUploadFlag(Hashtable mDhttpMethod) | 127 | private Hashtable MeshUploadFlag(Hashtable mDhttpMethod, UUID agentID) |
128 | { | 128 | { |
129 | // m_log.DebugFormat("[MESH UPLOAD FLAG MODULE]: MeshUploadFlag request"); | 129 | // m_log.DebugFormat("[MESH UPLOAD FLAG MODULE]: MeshUploadFlag request"); |
130 | 130 | ||
131 | OSDMap data = new OSDMap(); | 131 | OSDMap data = new OSDMap(); |
132 | ScenePresence sp = m_scene.GetScenePresence(m_agentID); | 132 | ScenePresence sp = m_scene.GetScenePresence(agentID); |
133 | data["username"] = sp.Firstname + "." + sp.Lastname; | 133 | data["username"] = sp.Firstname + "." + sp.Lastname; |
134 | data["display_name_next_update"] = new OSDDate(DateTime.Now); | 134 | data["display_name_next_update"] = new OSDDate(DateTime.Now); |
135 | data["legacy_first_name"] = sp.Firstname; | 135 | data["legacy_first_name"] = sp.Firstname; |
136 | data["mesh_upload_status"] = "valid"; | 136 | data["mesh_upload_status"] = "valid"; |
137 | data["display_name"] = sp.Firstname + " " + sp.Lastname; | 137 | data["display_name"] = sp.Firstname + " " + sp.Lastname; |
138 | data["legacy_last_name"] = sp.Lastname; | 138 | data["legacy_last_name"] = sp.Lastname; |
139 | data["id"] = m_agentID; | 139 | data["id"] = agentID; |
140 | data["is_display_name_default"] = true; | 140 | data["is_display_name_default"] = true; |
141 | 141 | ||
142 | //Send back data | 142 | //Send back data |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 5675870..6742d99 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -790,7 +790,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
790 | handshake.RegionInfo3.ColoName = Utils.EmptyBytes; | 790 | handshake.RegionInfo3.ColoName = Utils.EmptyBytes; |
791 | handshake.RegionInfo3.ProductName = Util.StringToBytes256(regionInfo.RegionType); | 791 | handshake.RegionInfo3.ProductName = Util.StringToBytes256(regionInfo.RegionType); |
792 | handshake.RegionInfo3.ProductSKU = Utils.EmptyBytes; | 792 | handshake.RegionInfo3.ProductSKU = Utils.EmptyBytes; |
793 | 793 | handshake.RegionInfo4 = new RegionHandshakePacket.RegionInfo4Block[0]; | |
794 | |||
794 | OutPacket(handshake, ThrottleOutPacketType.Task); | 795 | OutPacket(handshake, ThrottleOutPacketType.Task); |
795 | } | 796 | } |
796 | 797 | ||
@@ -3571,6 +3572,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3571 | 3572 | ||
3572 | avp.Sender.IsTrial = false; | 3573 | avp.Sender.IsTrial = false; |
3573 | avp.Sender.ID = agentID; | 3574 | avp.Sender.ID = agentID; |
3575 | avp.AppearanceData = new AvatarAppearancePacket.AppearanceDataBlock[0]; | ||
3574 | //m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); | 3576 | //m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); |
3575 | OutPacket(avp, ThrottleOutPacketType.Task); | 3577 | OutPacket(avp, ThrottleOutPacketType.Task); |
3576 | } | 3578 | } |
@@ -4192,7 +4194,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4192 | pack.Stat = stats.StatsBlock; | 4194 | pack.Stat = stats.StatsBlock; |
4193 | 4195 | ||
4194 | pack.Header.Reliable = false; | 4196 | pack.Header.Reliable = false; |
4195 | 4197 | pack.RegionInfo = new SimStatsPacket.RegionInfoBlock[0]; | |
4196 | OutPacket(pack, ThrottleOutPacketType.Task); | 4198 | OutPacket(pack, ThrottleOutPacketType.Task); |
4197 | } | 4199 | } |
4198 | 4200 | ||
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index ddaa227..121fb2a 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -156,9 +156,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
156 | 156 | ||
157 | public void Initialise(IConfigSource config) | 157 | public void Initialise(IConfigSource config) |
158 | { | 158 | { |
159 | IConfig myConfig = config.Configs["Startup"]; | 159 | string permissionModules = Util.GetConfigVarFromSections<string>(config, "permissionmodules", |
160 | 160 | new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); | |
161 | string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); | ||
162 | 161 | ||
163 | List<string> modules = new List<string>(permissionModules.Split(',')); | 162 | List<string> modules = new List<string>(permissionModules.Split(',')); |
164 | 163 | ||
@@ -167,26 +166,34 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
167 | 166 | ||
168 | m_Enabled = true; | 167 | m_Enabled = true; |
169 | 168 | ||
170 | m_allowGridGods = myConfig.GetBoolean("allow_grid_gods", false); | 169 | m_allowGridGods = Util.GetConfigVarFromSections<bool>(config, "allow_grid_gods", |
171 | m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); | 170 | new string[] { "Startup", "Permissions" }, false); |
172 | m_propagatePermissions = myConfig.GetBoolean("propagate_permissions", true); | 171 | m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(config, "serverside_object_permissions", |
173 | m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); | 172 | new string[] { "Startup", "Permissions" }, true); |
174 | m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); | 173 | m_propagatePermissions = Util.GetConfigVarFromSections<bool>(config, "propagate_permissions", |
175 | m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); | 174 | new string[] { "Startup", "Permissions" }, true); |
176 | 175 | m_RegionOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_owner_is_god", | |
177 | m_SimpleBuildPermissions = myConfig.GetBoolean("simple_build_permissions", false); | 176 | new string[] { "Startup", "Permissions" }, true); |
177 | m_RegionManagerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_manager_is_god", | ||
178 | new string[] { "Startup", "Permissions" }, false); | ||
179 | m_ParcelOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "parcel_owner_is_god", | ||
180 | new string[] { "Startup", "Permissions" }, true); | ||
181 | |||
182 | m_SimpleBuildPermissions = Util.GetConfigVarFromSections<bool>(config, "simple_build_permissions", | ||
183 | new string[] { "Startup", "Permissions" }, false); | ||
178 | 184 | ||
179 | m_allowedScriptCreators | 185 | m_allowedScriptCreators |
180 | = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators); | 186 | = ParseUserSetConfigSetting(config, "allowed_script_creators", m_allowedScriptCreators); |
181 | m_allowedScriptEditors | 187 | m_allowedScriptEditors |
182 | = ParseUserSetConfigSetting(myConfig, "allowed_script_editors", m_allowedScriptEditors); | 188 | = ParseUserSetConfigSetting(config, "allowed_script_editors", m_allowedScriptEditors); |
183 | 189 | ||
184 | if (m_bypassPermissions) | 190 | if (m_bypassPermissions) |
185 | m_log.Info("[PERMISSIONS]: serverside_object_permissions = false in ini file so disabling all region service permission checks"); | 191 | m_log.Info("[PERMISSIONS]: serverside_object_permissions = false in ini file so disabling all region service permission checks"); |
186 | else | 192 | else |
187 | m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); | 193 | m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); |
188 | 194 | ||
189 | string grant = myConfig.GetString("GrantLSL", ""); | 195 | string grant = Util.GetConfigVarFromSections<string>(config, "GrantLSL", |
196 | new string[] { "Startup", "Permissions" }, string.Empty); | ||
190 | if (grant.Length > 0) | 197 | if (grant.Length > 0) |
191 | { | 198 | { |
192 | foreach (string uuidl in grant.Split(',')) | 199 | foreach (string uuidl in grant.Split(',')) |
@@ -196,7 +203,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
196 | } | 203 | } |
197 | } | 204 | } |
198 | 205 | ||
199 | grant = myConfig.GetString("GrantCS", ""); | 206 | grant = Util.GetConfigVarFromSections<string>(config, "GrantCS", |
207 | new string[] { "Startup", "Permissions" }, string.Empty); | ||
200 | if (grant.Length > 0) | 208 | if (grant.Length > 0) |
201 | { | 209 | { |
202 | foreach (string uuidl in grant.Split(',')) | 210 | foreach (string uuidl in grant.Split(',')) |
@@ -206,7 +214,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
206 | } | 214 | } |
207 | } | 215 | } |
208 | 216 | ||
209 | grant = myConfig.GetString("GrantVB", ""); | 217 | grant = Util.GetConfigVarFromSections<string>(config, "GrantVB", |
218 | new string[] { "Startup", "Permissions" }, string.Empty); | ||
210 | if (grant.Length > 0) | 219 | if (grant.Length > 0) |
211 | { | 220 | { |
212 | foreach (string uuidl in grant.Split(',')) | 221 | foreach (string uuidl in grant.Split(',')) |
@@ -216,7 +225,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
216 | } | 225 | } |
217 | } | 226 | } |
218 | 227 | ||
219 | grant = myConfig.GetString("GrantJS", ""); | 228 | grant = Util.GetConfigVarFromSections<string>(config, "GrantJS", |
229 | new string[] { "Startup", "Permissions" }, string.Empty); | ||
220 | if (grant.Length > 0) | 230 | if (grant.Length > 0) |
221 | { | 231 | { |
222 | foreach (string uuidl in grant.Split(',')) | 232 | foreach (string uuidl in grant.Split(',')) |
@@ -226,7 +236,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
226 | } | 236 | } |
227 | } | 237 | } |
228 | 238 | ||
229 | grant = myConfig.GetString("GrantYP", ""); | 239 | grant = Util.GetConfigVarFromSections<string>(config, "GrantYP", |
240 | new string[] { "Startup", "Permissions" }, string.Empty); | ||
230 | if (grant.Length > 0) | 241 | if (grant.Length > 0) |
231 | { | 242 | { |
232 | foreach (string uuidl in grant.Split(',')) | 243 | foreach (string uuidl in grant.Split(',')) |
@@ -464,11 +475,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
464 | /// <param name="settingName"></param> | 475 | /// <param name="settingName"></param> |
465 | /// <param name="defaultValue">The default value for this attribute</param> | 476 | /// <param name="defaultValue">The default value for this attribute</param> |
466 | /// <returns>The parsed value</returns> | 477 | /// <returns>The parsed value</returns> |
467 | private static UserSet ParseUserSetConfigSetting(IConfig config, string settingName, UserSet defaultValue) | 478 | private static UserSet ParseUserSetConfigSetting(IConfigSource config, string settingName, UserSet defaultValue) |
468 | { | 479 | { |
469 | UserSet userSet = defaultValue; | 480 | UserSet userSet = defaultValue; |
470 | 481 | ||
471 | string rawSetting = config.GetString(settingName, defaultValue.ToString()); | 482 | string rawSetting = Util.GetConfigVarFromSections<string>(config, settingName, |
483 | new string[] {"Startup", "Permissions"}, defaultValue.ToString()); | ||
472 | 484 | ||
473 | // Temporary measure to allow 'gods' to be specified in config for consistency's sake. In the long term | 485 | // Temporary measure to allow 'gods' to be specified in config for consistency's sake. In the long term |
474 | // this should disappear. | 486 | // this should disappear. |
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index 32017a8..dd48dd5 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | |||
@@ -148,8 +148,6 @@ namespace OpenSim.Region.DataSnapshot | |||
148 | return; | 148 | return; |
149 | } | 149 | } |
150 | 150 | ||
151 | if (m_enabled) | ||
152 | m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); | ||
153 | } | 151 | } |
154 | 152 | ||
155 | } | 153 | } |
@@ -163,8 +161,22 @@ namespace OpenSim.Region.DataSnapshot | |||
163 | 161 | ||
164 | m_log.DebugFormat("[DATASNAPSHOT]: Module added to Scene {0}.", scene.RegionInfo.RegionName); | 162 | m_log.DebugFormat("[DATASNAPSHOT]: Module added to Scene {0}.", scene.RegionInfo.RegionName); |
165 | 163 | ||
166 | m_snapStore.AddScene(scene); | 164 | if (!m_servicesNotified) |
165 | { | ||
166 | m_hostname = scene.RegionInfo.ExternalHostName; | ||
167 | m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); | ||
168 | |||
169 | //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer | ||
170 | new DataRequestHandler(scene, this); | ||
171 | |||
172 | if (m_dataServices != "" && m_dataServices != "noservices") | ||
173 | NotifyDataServices(m_dataServices, "online"); | ||
174 | |||
175 | m_servicesNotified = true; | ||
176 | } | ||
177 | |||
167 | m_scenes.Add(scene); | 178 | m_scenes.Add(scene); |
179 | m_snapStore.AddScene(scene); | ||
168 | 180 | ||
169 | Assembly currentasm = Assembly.GetExecutingAssembly(); | 181 | Assembly currentasm = Assembly.GetExecutingAssembly(); |
170 | 182 | ||
@@ -189,22 +201,6 @@ namespace OpenSim.Region.DataSnapshot | |||
189 | } | 201 | } |
190 | } | 202 | } |
191 | 203 | ||
192 | // Must be done here because on shared modules, PostInitialise() will run | ||
193 | // BEFORE any scenes are registered. There is no "all scenes have been loaded" | ||
194 | // kind of callback because scenes may be created dynamically, so we cannot | ||
195 | // have that info, ever. | ||
196 | if (!m_servicesNotified) | ||
197 | { | ||
198 | //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer | ||
199 | new DataRequestHandler(m_scenes[0], this); | ||
200 | |||
201 | m_hostname = m_scenes[0].RegionInfo.ExternalHostName; | ||
202 | |||
203 | if (m_dataServices != "" && m_dataServices != "noservices") | ||
204 | NotifyDataServices(m_dataServices, "online"); | ||
205 | |||
206 | m_servicesNotified = true; | ||
207 | } | ||
208 | } | 204 | } |
209 | 205 | ||
210 | public void RemoveRegion(Scene scene) | 206 | public void RemoveRegion(Scene scene) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5b61538..14dac7a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -932,7 +932,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
932 | } | 932 | } |
933 | } | 933 | } |
934 | 934 | ||
935 | string grant = startupConfig.GetString("AllowedClients", String.Empty); | 935 | string[] possibleAccessControlConfigSections = new string[] { "AccessControl", "Startup" }; |
936 | |||
937 | string grant | ||
938 | = Util.GetConfigVarFromSections<string>( | ||
939 | config, "AllowedClients", possibleAccessControlConfigSections, ""); | ||
940 | |||
936 | if (grant.Length > 0) | 941 | if (grant.Length > 0) |
937 | { | 942 | { |
938 | foreach (string viewer in grant.Split('|')) | 943 | foreach (string viewer in grant.Split('|')) |
@@ -941,7 +946,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
941 | } | 946 | } |
942 | } | 947 | } |
943 | 948 | ||
944 | grant = startupConfig.GetString("BannedClients", String.Empty); | 949 | grant |
950 | = Util.GetConfigVarFromSections<string>( | ||
951 | config, "BannedClients", possibleAccessControlConfigSections, ""); | ||
952 | |||
945 | if (grant.Length > 0) | 953 | if (grant.Length > 0) |
946 | { | 954 | { |
947 | foreach (string viewer in grant.Split('|')) | 955 | foreach (string viewer in grant.Split('|')) |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index df819ec..6e0ea7d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | |||
@@ -130,7 +130,7 @@ namespace OpenSim.Region.Framework.Tests | |||
130 | SceneObjectPart sop1 = sog1.RootPart; | 130 | SceneObjectPart sop1 = sog1.RootPart; |
131 | TaskInventoryItem sopItem1 | 131 | TaskInventoryItem sopItem1 |
132 | = TaskInventoryHelpers.AddNotecard( | 132 | = TaskInventoryHelpers.AddNotecard( |
133 | scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900)); | 133 | scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); |
134 | 134 | ||
135 | InventoryFolderBase folder | 135 | InventoryFolderBase folder |
136 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; | 136 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; |
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Framework.Tests | |||
162 | SceneObjectPart sop1 = sog1.RootPart; | 162 | SceneObjectPart sop1 = sog1.RootPart; |
163 | TaskInventoryItem sopItem1 | 163 | TaskInventoryItem sopItem1 |
164 | = TaskInventoryHelpers.AddNotecard( | 164 | = TaskInventoryHelpers.AddNotecard( |
165 | scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900)); | 165 | scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); |
166 | 166 | ||
167 | // Perform test | 167 | // Perform test |
168 | scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID); | 168 | scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID); |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs index d7fb272..1e7bc02 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs | |||
@@ -76,7 +76,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments | |||
76 | 76 | ||
77 | if (m_console != null) | 77 | if (m_console != null) |
78 | { | 78 | { |
79 | m_console.AddCommand("TempATtachModule", false, "set auto_grant_attach_perms", "set auto_grant_attach_perms true|false", "Allow objects owned by the region owner os estate managers to obtain attach permissions without asking the user", SetAutoGrantAttachPerms); | 79 | m_console.AddCommand("TempAttachModule", false, "set auto_grant_attach_perms", "set auto_grant_attach_perms true|false", "Allow objects owned by the region owner or estate managers to obtain attach permissions without asking the user", SetAutoGrantAttachPerms); |
80 | } | 80 | } |
81 | } | 81 | } |
82 | else | 82 | else |
diff --git a/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs b/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs index ad2fc7a..0615036 100644 --- a/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs +++ b/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs | |||
@@ -33,10 +33,11 @@ using Nini.Config; | |||
33 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
35 | 35 | ||
36 | // You will need to uncomment this line if you are adding a region module to some other assembly which does not already | 36 | // You will need to uncomment these lines if you are adding a region module to some other assembly which does not already |
37 | // specify its assembly. Otherwise, the region modules in the assembly will not be picked up when OpenSimulator scans | 37 | // specify its assembly. Otherwise, the region modules in the assembly will not be picked up when OpenSimulator scans |
38 | // the available DLLs | 38 | // the available DLLs |
39 | //[assembly: Addin("MyModule", "1.0")] | 39 | //[assembly: Addin("MyModule", "1.0")] |
40 | //[assembly: AddinDependency("OpenSim", "0.5")] | ||
40 | 41 | ||
41 | namespace OpenSim.Region.OptionalModules.Example.BareBonesNonShared | 42 | namespace OpenSim.Region.OptionalModules.Example.BareBonesNonShared |
42 | { | 43 | { |
diff --git a/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs b/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs index bb9cbb7..811a263 100644 --- a/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs +++ b/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs | |||
@@ -33,10 +33,11 @@ using Nini.Config; | |||
33 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
35 | 35 | ||
36 | // You will need to uncomment this line if you are adding a region module to some other assembly which does not already | 36 | // You will need to uncomment these lines if you are adding a region module to some other assembly which does not already |
37 | // specify its assembly. Otherwise, the region modules in the assembly will not be picked up when OpenSimulator scans | 37 | // specify its assembly. Otherwise, the region modules in the assembly will not be picked up when OpenSimulator scans |
38 | // the available DLLs | 38 | // the available DLLs |
39 | //[assembly: Addin("MyModule", "1.0")] | 39 | //[assembly: Addin("MyModule", "1.0")] |
40 | //[assembly: AddinDependency("OpenSim", "0.5")] | ||
40 | 41 | ||
41 | namespace OpenSim.Region.OptionalModules.Example.BareBonesShared | 42 | namespace OpenSim.Region.OptionalModules.Example.BareBonesShared |
42 | { | 43 | { |
diff --git a/OpenSim/Region/OptionalModules/Example/WebSocketEchoTest/WebSocketEchoModule.cs b/OpenSim/Region/OptionalModules/Example/WebSocketEchoTest/WebSocketEchoModule.cs index 112ba4e..5bf0ed4 100644 --- a/OpenSim/Region/OptionalModules/Example/WebSocketEchoTest/WebSocketEchoModule.cs +++ b/OpenSim/Region/OptionalModules/Example/WebSocketEchoTest/WebSocketEchoModule.cs | |||
@@ -45,6 +45,7 @@ namespace OpenSim.Region.OptionalModules.WebSocketEchoModule | |||
45 | public class WebSocketEchoModule : ISharedRegionModule | 45 | public class WebSocketEchoModule : ISharedRegionModule |
46 | { | 46 | { |
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | |||
48 | private bool enabled; | 49 | private bool enabled; |
49 | public string Name { get { return "WebSocketEchoModule"; } } | 50 | public string Name { get { return "WebSocketEchoModule"; } } |
50 | 51 | ||
@@ -55,9 +56,9 @@ namespace OpenSim.Region.OptionalModules.WebSocketEchoModule | |||
55 | 56 | ||
56 | public void Initialise(IConfigSource pConfig) | 57 | public void Initialise(IConfigSource pConfig) |
57 | { | 58 | { |
58 | enabled =(pConfig.Configs["WebSocketEcho"] != null); | 59 | enabled = (pConfig.Configs["WebSocketEcho"] != null); |
59 | if (enabled) | 60 | // if (enabled) |
60 | m_log.DebugFormat("[WebSocketEchoModule]: INITIALIZED MODULE"); | 61 | // m_log.DebugFormat("[WebSocketEchoModule]: INITIALIZED MODULE"); |
61 | } | 62 | } |
62 | 63 | ||
63 | /// <summary> | 64 | /// <summary> |
@@ -158,17 +159,17 @@ namespace OpenSim.Region.OptionalModules.WebSocketEchoModule | |||
158 | 159 | ||
159 | public void AddRegion(Scene scene) | 160 | public void AddRegion(Scene scene) |
160 | { | 161 | { |
161 | m_log.DebugFormat("[WebSocketEchoModule]: REGION {0} ADDED", scene.RegionInfo.RegionName); | 162 | // m_log.DebugFormat("[WebSocketEchoModule]: REGION {0} ADDED", scene.RegionInfo.RegionName); |
162 | } | 163 | } |
163 | 164 | ||
164 | public void RemoveRegion(Scene scene) | 165 | public void RemoveRegion(Scene scene) |
165 | { | 166 | { |
166 | m_log.DebugFormat("[WebSocketEchoModule]: REGION {0} REMOVED", scene.RegionInfo.RegionName); | 167 | // m_log.DebugFormat("[WebSocketEchoModule]: REGION {0} REMOVED", scene.RegionInfo.RegionName); |
167 | } | 168 | } |
168 | 169 | ||
169 | public void RegionLoaded(Scene scene) | 170 | public void RegionLoaded(Scene scene) |
170 | { | 171 | { |
171 | m_log.DebugFormat("[WebSocketEchoModule]: REGION {0} LOADED", scene.RegionInfo.RegionName); | 172 | // m_log.DebugFormat("[WebSocketEchoModule]: REGION {0} LOADED", scene.RegionInfo.RegionName); |
172 | } | 173 | } |
173 | } | 174 | } |
174 | } \ No newline at end of file | 175 | } \ No newline at end of file |
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index c1957e2..a6d43f1 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | |||
@@ -57,9 +57,10 @@ namespace OpenSim.Region.OptionalModules | |||
57 | 57 | ||
58 | public void Initialise(IConfigSource config) | 58 | public void Initialise(IConfigSource config) |
59 | { | 59 | { |
60 | IConfig myConfig = config.Configs["Startup"]; | 60 | //IConfig myConfig = config.Configs["Startup"]; |
61 | 61 | ||
62 | string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); | 62 | string permissionModules = Util.GetConfigVarFromSections<string>(config, "permissionmodules", |
63 | new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); | ||
63 | 64 | ||
64 | List<string> modules=new List<string>(permissionModules.Split(',')); | 65 | List<string> modules=new List<string>(permissionModules.Split(',')); |
65 | 66 | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index e6933f9..235cefc 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -961,13 +961,13 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
961 | // ================================================================== | 961 | // ================================================================== |
962 | // Clamp high or low velocities | 962 | // Clamp high or low velocities |
963 | float newVelocityLengthSq = VehicleVelocity.LengthSquared(); | 963 | float newVelocityLengthSq = VehicleVelocity.LengthSquared(); |
964 | if (newVelocityLengthSq > BSParam.VehicleMaxLinearVelocitySq) | 964 | if (newVelocityLengthSq > BSParam.VehicleMaxLinearVelocitySquared) |
965 | { | 965 | { |
966 | Vector3 origVelW = VehicleVelocity; // DEBUG DEBUG | 966 | Vector3 origVelW = VehicleVelocity; // DEBUG DEBUG |
967 | VehicleVelocity /= VehicleVelocity.Length(); | 967 | VehicleVelocity /= VehicleVelocity.Length(); |
968 | VehicleVelocity *= BSParam.VehicleMaxLinearVelocity; | 968 | VehicleVelocity *= BSParam.VehicleMaxLinearVelocity; |
969 | VDetailLog("{0}, MoveLinear,clampMax,origVelW={1},lenSq={2},maxVelSq={3},,newVelW={4}", | 969 | VDetailLog("{0}, MoveLinear,clampMax,origVelW={1},lenSq={2},maxVelSq={3},,newVelW={4}", |
970 | Prim.LocalID, origVelW, newVelocityLengthSq, BSParam.VehicleMaxLinearVelocitySq, VehicleVelocity); | 970 | Prim.LocalID, origVelW, newVelocityLengthSq, BSParam.VehicleMaxLinearVelocitySquared, VehicleVelocity); |
971 | } | 971 | } |
972 | else if (newVelocityLengthSq < 0.001f) | 972 | else if (newVelocityLengthSq < 0.001f) |
973 | VehicleVelocity = Vector3.Zero; | 973 | VehicleVelocity = Vector3.Zero; |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index dc57b67..fa58109 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | |||
@@ -47,12 +47,16 @@ public static class BSParam | |||
47 | public static float SculptLOD { get; private set; } | 47 | public static float SculptLOD { get; private set; } |
48 | 48 | ||
49 | public static int CrossingFailuresBeforeOutOfBounds { get; private set; } | 49 | public static int CrossingFailuresBeforeOutOfBounds { get; private set; } |
50 | public static float UpdateVelocityChangeThreshold { get; private set; } | ||
50 | 51 | ||
51 | public static float MinimumObjectMass { get; private set; } | 52 | public static float MinimumObjectMass { get; private set; } |
52 | public static float MaximumObjectMass { get; private set; } | 53 | public static float MaximumObjectMass { get; private set; } |
53 | public static float MaxLinearVelocity { get; private set; } | 54 | public static float MaxLinearVelocity { get; private set; } |
55 | public static float MaxLinearVelocitySquared { get; private set; } | ||
54 | public static float MaxAngularVelocity { get; private set; } | 56 | public static float MaxAngularVelocity { get; private set; } |
57 | public static float MaxAngularVelocitySquared { get; private set; } | ||
55 | public static float MaxAddForceMagnitude { get; private set; } | 58 | public static float MaxAddForceMagnitude { get; private set; } |
59 | public static float MaxAddForceMagnitudeSquared { get; private set; } | ||
56 | public static float DensityScaleFactor { get; private set; } | 60 | public static float DensityScaleFactor { get; private set; } |
57 | 61 | ||
58 | public static float LinearDamping { get; private set; } | 62 | public static float LinearDamping { get; private set; } |
@@ -109,7 +113,7 @@ public static class BSParam | |||
109 | 113 | ||
110 | // Vehicle parameters | 114 | // Vehicle parameters |
111 | public static float VehicleMaxLinearVelocity { get; private set; } | 115 | public static float VehicleMaxLinearVelocity { get; private set; } |
112 | public static float VehicleMaxLinearVelocitySq { get; private set; } | 116 | public static float VehicleMaxLinearVelocitySquared { get; private set; } |
113 | public static float VehicleMaxAngularVelocity { get; private set; } | 117 | public static float VehicleMaxAngularVelocity { get; private set; } |
114 | public static float VehicleMaxAngularVelocitySq { get; private set; } | 118 | public static float VehicleMaxAngularVelocitySq { get; private set; } |
115 | public static float VehicleAngularDamping { get; private set; } | 119 | public static float VehicleAngularDamping { get; private set; } |
@@ -265,7 +269,7 @@ public static class BSParam | |||
265 | // The single letter parameters for the delegates are: | 269 | // The single letter parameters for the delegates are: |
266 | // s = BSScene | 270 | // s = BSScene |
267 | // o = BSPhysObject | 271 | // o = BSPhysObject |
268 | // v = value (float) | 272 | // v = value (appropriate type) |
269 | private static ParameterDefnBase[] ParameterDefinitions = | 273 | private static ParameterDefnBase[] ParameterDefinitions = |
270 | { | 274 | { |
271 | new ParameterDefn<bool>("MeshSculptedPrim", "Whether to create meshes for sculpties", | 275 | new ParameterDefn<bool>("MeshSculptedPrim", "Whether to create meshes for sculpties", |
@@ -289,6 +293,10 @@ public static class BSParam | |||
289 | 5, | 293 | 5, |
290 | (s) => { return CrossingFailuresBeforeOutOfBounds; }, | 294 | (s) => { return CrossingFailuresBeforeOutOfBounds; }, |
291 | (s,v) => { CrossingFailuresBeforeOutOfBounds = v; } ), | 295 | (s,v) => { CrossingFailuresBeforeOutOfBounds = v; } ), |
296 | new ParameterDefn<float>("UpdateVelocityChangeThreshold", "Change in updated velocity required before reporting change to simulator", | ||
297 | 0.1f, | ||
298 | (s) => { return UpdateVelocityChangeThreshold; }, | ||
299 | (s,v) => { UpdateVelocityChangeThreshold = v; } ), | ||
292 | 300 | ||
293 | new ParameterDefn<float>("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)", | 301 | new ParameterDefn<float>("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)", |
294 | 32f, | 302 | 32f, |
@@ -343,16 +351,16 @@ public static class BSParam | |||
343 | new ParameterDefn<float>("MaxLinearVelocity", "Maximum velocity magnitude that can be assigned to an object", | 351 | new ParameterDefn<float>("MaxLinearVelocity", "Maximum velocity magnitude that can be assigned to an object", |
344 | 1000.0f, | 352 | 1000.0f, |
345 | (s) => { return MaxLinearVelocity; }, | 353 | (s) => { return MaxLinearVelocity; }, |
346 | (s,v) => { MaxLinearVelocity = v; } ), | 354 | (s,v) => { MaxLinearVelocity = v; MaxLinearVelocitySquared = v * v; } ), |
347 | new ParameterDefn<float>("MaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to an object", | 355 | new ParameterDefn<float>("MaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to an object", |
348 | 1000.0f, | 356 | 1000.0f, |
349 | (s) => { return MaxAngularVelocity; }, | 357 | (s) => { return MaxAngularVelocity; }, |
350 | (s,v) => { MaxAngularVelocity = v; } ), | 358 | (s,v) => { MaxAngularVelocity = v; MaxAngularVelocitySquared = v * v; } ), |
351 | // LL documentation says thie number should be 20f for llApplyImpulse and 200f for llRezObject | 359 | // LL documentation says thie number should be 20f for llApplyImpulse and 200f for llRezObject |
352 | new ParameterDefn<float>("MaxAddForceMagnitude", "Maximum force that can be applied by llApplyImpulse (SL says 20f)", | 360 | new ParameterDefn<float>("MaxAddForceMagnitude", "Maximum force that can be applied by llApplyImpulse (SL says 20f)", |
353 | 20000.0f, | 361 | 20000.0f, |
354 | (s) => { return MaxAddForceMagnitude; }, | 362 | (s) => { return MaxAddForceMagnitude; }, |
355 | (s,v) => { MaxAddForceMagnitude = v; } ), | 363 | (s,v) => { MaxAddForceMagnitude = v; MaxAddForceMagnitudeSquared = v * v; } ), |
356 | // Density is passed around as 100kg/m3. This scales that to 1kg/m3. | 364 | // Density is passed around as 100kg/m3. This scales that to 1kg/m3. |
357 | new ParameterDefn<float>("DensityScaleFactor", "Conversion for simulator/viewer density (100kg/m3) to physical density (1kg/m3)", | 365 | new ParameterDefn<float>("DensityScaleFactor", "Conversion for simulator/viewer density (100kg/m3) to physical density (1kg/m3)", |
358 | 0.01f, | 366 | 0.01f, |
@@ -505,7 +513,7 @@ public static class BSParam | |||
505 | new ParameterDefn<float>("VehicleMaxLinearVelocity", "Maximum velocity magnitude that can be assigned to a vehicle", | 513 | new ParameterDefn<float>("VehicleMaxLinearVelocity", "Maximum velocity magnitude that can be assigned to a vehicle", |
506 | 1000.0f, | 514 | 1000.0f, |
507 | (s) => { return (float)VehicleMaxLinearVelocity; }, | 515 | (s) => { return (float)VehicleMaxLinearVelocity; }, |
508 | (s,v) => { VehicleMaxLinearVelocity = v; VehicleMaxLinearVelocitySq = v * v; } ), | 516 | (s,v) => { VehicleMaxLinearVelocity = v; VehicleMaxLinearVelocitySquared = v * v; } ), |
509 | new ParameterDefn<float>("VehicleMaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to a vehicle", | 517 | new ParameterDefn<float>("VehicleMaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to a vehicle", |
510 | 12.0f, | 518 | 12.0f, |
511 | (s) => { return (float)VehicleMaxAngularVelocity; }, | 519 | (s) => { return (float)VehicleMaxAngularVelocity; }, |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 8f660c4..a465613 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -108,6 +108,9 @@ public class BSPrim : BSPhysObject | |||
108 | // do the actual object creation at taint time | 108 | // do the actual object creation at taint time |
109 | PhysicsScene.TaintedObject("BSPrim.create", delegate() | 109 | PhysicsScene.TaintedObject("BSPrim.create", delegate() |
110 | { | 110 | { |
111 | // Make sure the object is being created with some sanity. | ||
112 | ExtremeSanityCheck(true /* inTaintTime */); | ||
113 | |||
111 | CreateGeomAndObject(true); | 114 | CreateGeomAndObject(true); |
112 | 115 | ||
113 | CurrentCollisionFlags = PhysicsScene.PE.GetCollisionFlags(PhysBody); | 116 | CurrentCollisionFlags = PhysicsScene.PE.GetCollisionFlags(PhysBody); |
@@ -450,6 +453,38 @@ public class BSPrim : BSPhysObject | |||
450 | return ret; | 453 | return ret; |
451 | } | 454 | } |
452 | 455 | ||
456 | // Occasionally things will fly off and really get lost. | ||
457 | // Find the wanderers and bring them back. | ||
458 | // Return 'true' if some parameter need some sanity. | ||
459 | private bool ExtremeSanityCheck(bool inTaintTime) | ||
460 | { | ||
461 | bool ret = false; | ||
462 | |||
463 | uint wayOutThere = Constants.RegionSize * Constants.RegionSize; | ||
464 | // There have been instances of objects getting thrown way out of bounds and crashing | ||
465 | // the border crossing code. | ||
466 | if ( _position.X < -Constants.RegionSize || _position.X > wayOutThere | ||
467 | || _position.Y < -Constants.RegionSize || _position.Y > wayOutThere | ||
468 | || _position.Z < -Constants.RegionSize || _position.Z > wayOutThere) | ||
469 | { | ||
470 | _position = new OMV.Vector3(10, 10, 50); | ||
471 | ZeroMotion(inTaintTime); | ||
472 | ret = true; | ||
473 | } | ||
474 | if (_velocity.LengthSquared() > BSParam.MaxLinearVelocity) | ||
475 | { | ||
476 | _velocity = Util.ClampV(_velocity, BSParam.MaxLinearVelocity); | ||
477 | ret = true; | ||
478 | } | ||
479 | if (_rotationalVelocity.LengthSquared() > BSParam.MaxAngularVelocitySquared) | ||
480 | { | ||
481 | _rotationalVelocity = Util.ClampV(_rotationalVelocity, BSParam.MaxAngularVelocity); | ||
482 | ret = true; | ||
483 | } | ||
484 | |||
485 | return ret; | ||
486 | } | ||
487 | |||
453 | // Return the effective mass of the object. | 488 | // Return the effective mass of the object. |
454 | // The definition of this call is to return the mass of the prim. | 489 | // The definition of this call is to return the mass of the prim. |
455 | // If the simulator cares about the mass of the linkset, it will sum it itself. | 490 | // If the simulator cares about the mass of the linkset, it will sum it itself. |
@@ -585,12 +620,12 @@ public class BSPrim : BSPhysObject | |||
585 | if (VehicleController.Type == Vehicle.TYPE_NONE) | 620 | if (VehicleController.Type == Vehicle.TYPE_NONE) |
586 | { | 621 | { |
587 | UnRegisterPreStepAction("BSPrim.Vehicle", LocalID); | 622 | UnRegisterPreStepAction("BSPrim.Vehicle", LocalID); |
588 | PhysicsScene.AfterStep -= VehicleController.PostStep; | 623 | UnRegisterPostStepAction("BSPrim.Vehicle", LocalID); |
589 | } | 624 | } |
590 | else | 625 | else |
591 | { | 626 | { |
592 | RegisterPreStepAction("BSPrim.Vehicle", LocalID, VehicleController.Step); | 627 | RegisterPreStepAction("BSPrim.Vehicle", LocalID, VehicleController.Step); |
593 | PhysicsScene.AfterStep += VehicleController.PostStep; | 628 | RegisterPostStepAction("BSPrim.Vehicle", LocalID, VehicleController.PostStep); |
594 | } | 629 | } |
595 | }); | 630 | }); |
596 | } | 631 | } |
@@ -732,7 +767,7 @@ public class BSPrim : BSPhysObject | |||
732 | set { | 767 | set { |
733 | PhysicsScene.AssertInTaintTime("BSPrim.ForceVelocity"); | 768 | PhysicsScene.AssertInTaintTime("BSPrim.ForceVelocity"); |
734 | 769 | ||
735 | _velocity = value; | 770 | _velocity = Util.ClampV(value, BSParam.MaxLinearVelocity); |
736 | if (PhysBody.HasPhysicalBody) | 771 | if (PhysBody.HasPhysicalBody) |
737 | { | 772 | { |
738 | DetailLog("{0},BSPrim.ForceVelocity,taint,vel={1}", LocalID, _velocity); | 773 | DetailLog("{0},BSPrim.ForceVelocity,taint,vel={1}", LocalID, _velocity); |
@@ -1098,7 +1133,7 @@ public class BSPrim : BSPhysObject | |||
1098 | return _rotationalVelocity; | 1133 | return _rotationalVelocity; |
1099 | } | 1134 | } |
1100 | set { | 1135 | set { |
1101 | _rotationalVelocity = value; | 1136 | _rotationalVelocity = Util.ClampV(value, BSParam.MaxAngularVelocity); |
1102 | if (PhysBody.HasPhysicalBody) | 1137 | if (PhysBody.HasPhysicalBody) |
1103 | { | 1138 | { |
1104 | DetailLog("{0},BSPrim.ForceRotationalVel,taint,rotvel={1}", LocalID, _rotationalVelocity); | 1139 | DetailLog("{0},BSPrim.ForceRotationalVel,taint,rotvel={1}", LocalID, _rotationalVelocity); |
@@ -1230,6 +1265,7 @@ public class BSPrim : BSPhysObject | |||
1230 | 1265 | ||
1231 | RegisterPreStepAction("BSPrim.Hover", LocalID, delegate(float timeStep) | 1266 | RegisterPreStepAction("BSPrim.Hover", LocalID, delegate(float timeStep) |
1232 | { | 1267 | { |
1268 | // Don't do hovering while the object is selected. | ||
1233 | if (!IsPhysicallyActive) | 1269 | if (!IsPhysicallyActive) |
1234 | return; | 1270 | return; |
1235 | 1271 | ||
@@ -1737,10 +1773,9 @@ public class BSPrim : BSPhysObject | |||
1737 | // Assign directly to the local variables so the normal set actions do not happen | 1773 | // Assign directly to the local variables so the normal set actions do not happen |
1738 | _position = entprop.Position; | 1774 | _position = entprop.Position; |
1739 | _orientation = entprop.Rotation; | 1775 | _orientation = entprop.Rotation; |
1740 | // _velocity = entprop.Velocity; | ||
1741 | // DEBUG DEBUG DEBUG -- smooth velocity changes a bit. The simulator seems to be | 1776 | // DEBUG DEBUG DEBUG -- smooth velocity changes a bit. The simulator seems to be |
1742 | // very sensitive to velocity changes. | 1777 | // very sensitive to velocity changes. |
1743 | if (entprop.Velocity == OMV.Vector3.Zero || !entprop.Velocity.ApproxEquals(_velocity, 0.1f)) | 1778 | if (entprop.Velocity == OMV.Vector3.Zero || !entprop.Velocity.ApproxEquals(_velocity, BSParam.UpdateVelocityChangeThreshold)) |
1744 | _velocity = entprop.Velocity; | 1779 | _velocity = entprop.Velocity; |
1745 | _acceleration = entprop.Acceleration; | 1780 | _acceleration = entprop.Acceleration; |
1746 | _rotationalVelocity = entprop.RotationalVelocity; | 1781 | _rotationalVelocity = entprop.RotationalVelocity; |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt index 4dc16f4..8a15abe 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt | |||
@@ -9,6 +9,9 @@ Enable vehicle border crossings (at least as poorly as ODE) | |||
9 | Lock axis | 9 | Lock axis |
10 | Deleting a linkset while standing on the root will leave the physical shape of the root behind. | 10 | Deleting a linkset while standing on the root will leave the physical shape of the root behind. |
11 | Not sure if it is because standing on it. Done with large prim linksets. | 11 | Not sure if it is because standing on it. Done with large prim linksets. |
12 | Linkset child rotations. | ||
13 | Nebadon spiral tube has middle sections which are rotated wrong. | ||
14 | Select linked spiral tube. Delink and note where the middle section ends up. | ||
12 | Vehicle angular vertical attraction | 15 | Vehicle angular vertical attraction |
13 | vehicle angular banking | 16 | vehicle angular banking |
14 | Center-of-gravity | 17 | Center-of-gravity |
@@ -68,6 +71,8 @@ Vehicle attributes are not restored when a vehicle is rezzed on region creation | |||
68 | 71 | ||
69 | GENERAL TODO LIST: | 72 | GENERAL TODO LIST: |
70 | ================================================= | 73 | ================================================= |
74 | Explore btGImpactMeshShape as alternative to convex hulls for simplified physical objects. | ||
75 | Regular triangle meshes don't do physical collisions. | ||
71 | Resitution of a prim works on another prim but not on terrain. | 76 | Resitution of a prim works on another prim but not on terrain. |
72 | The dropped prim doesn't bounce properly on the terrain. | 77 | The dropped prim doesn't bounce properly on the terrain. |
73 | Add a sanity check for PIDTarget location. | 78 | Add a sanity check for PIDTarget location. |
@@ -338,4 +343,4 @@ Avatar standing on a moving object should start to move with the object. (DONE 2 | |||
338 | Angular motion around Z moves the vehicle in world Z and not vehicle Z in ODE. | 343 | Angular motion around Z moves the vehicle in world Z and not vehicle Z in ODE. |
339 | Verify that angular motion specified around Z moves in the vehicle coordinates. | 344 | Verify that angular motion specified around Z moves in the vehicle coordinates. |
340 | DONE 20130120: BulletSim properly applies force in vehicle relative coordinates. | 345 | DONE 20130120: BulletSim properly applies force in vehicle relative coordinates. |
341 | Nebadon vehicles turning funny in arena (DONE) \ No newline at end of file | 346 | Nebadon vehicles turning funny in arena (DONE) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6a31568..ab087af 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -10806,14 +10806,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10806 | return UUID.Zero.ToString(); | 10806 | return UUID.Zero.ToString(); |
10807 | } | 10807 | } |
10808 | 10808 | ||
10809 | string reqIdentifier = UUID.Random().ToString(); | ||
10810 | |||
10809 | // was: UUID tid = tid = AsyncCommands. | 10811 | // was: UUID tid = tid = AsyncCommands. |
10810 | UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, assetID.ToString()); | 10812 | UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, reqIdentifier); |
10811 | 10813 | ||
10812 | if (NotecardCache.IsCached(assetID)) | 10814 | if (NotecardCache.IsCached(assetID)) |
10813 | { | 10815 | { |
10814 | AsyncCommands. | 10816 | AsyncCommands.DataserverPlugin.DataserverReply(reqIdentifier, NotecardCache.GetLines(assetID).ToString()); |
10815 | DataserverPlugin.DataserverReply(assetID.ToString(), | 10817 | |
10816 | NotecardCache.GetLines(assetID).ToString()); | ||
10817 | ScriptSleep(100); | 10818 | ScriptSleep(100); |
10818 | return tid.ToString(); | 10819 | return tid.ToString(); |
10819 | } | 10820 | } |
@@ -10829,9 +10830,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10829 | string data = Encoding.UTF8.GetString(a.Data); | 10830 | string data = Encoding.UTF8.GetString(a.Data); |
10830 | //m_log.Debug(data); | 10831 | //m_log.Debug(data); |
10831 | NotecardCache.Cache(id, data); | 10832 | NotecardCache.Cache(id, data); |
10832 | AsyncCommands. | 10833 | AsyncCommands.DataserverPlugin.DataserverReply(reqIdentifier, NotecardCache.GetLines(id).ToString()); |
10833 | DataserverPlugin.DataserverReply(id.ToString(), | ||
10834 | NotecardCache.GetLines(id).ToString()); | ||
10835 | }); | 10834 | }); |
10836 | 10835 | ||
10837 | ScriptSleep(100); | 10836 | ScriptSleep(100); |
@@ -10860,13 +10859,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10860 | return UUID.Zero.ToString(); | 10859 | return UUID.Zero.ToString(); |
10861 | } | 10860 | } |
10862 | 10861 | ||
10862 | string reqIdentifier = UUID.Random().ToString(); | ||
10863 | |||
10863 | // was: UUID tid = tid = AsyncCommands. | 10864 | // was: UUID tid = tid = AsyncCommands. |
10864 | UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, assetID.ToString()); | 10865 | UUID tid = AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, reqIdentifier); |
10865 | 10866 | ||
10866 | if (NotecardCache.IsCached(assetID)) | 10867 | if (NotecardCache.IsCached(assetID)) |
10867 | { | 10868 | { |
10868 | AsyncCommands.DataserverPlugin.DataserverReply(assetID.ToString(), | 10869 | AsyncCommands.DataserverPlugin.DataserverReply( |
10869 | NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax)); | 10870 | reqIdentifier, NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax)); |
10871 | |||
10870 | ScriptSleep(100); | 10872 | ScriptSleep(100); |
10871 | return tid.ToString(); | 10873 | return tid.ToString(); |
10872 | } | 10874 | } |
@@ -10882,8 +10884,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10882 | string data = Encoding.UTF8.GetString(a.Data); | 10884 | string data = Encoding.UTF8.GetString(a.Data); |
10883 | //m_log.Debug(data); | 10885 | //m_log.Debug(data); |
10884 | NotecardCache.Cache(id, data); | 10886 | NotecardCache.Cache(id, data); |
10885 | AsyncCommands.DataserverPlugin.DataserverReply(id.ToString(), | 10887 | AsyncCommands.DataserverPlugin.DataserverReply( |
10886 | NotecardCache.GetLine(id, line, m_notecardLineReadCharsMax)); | 10888 | reqIdentifier, NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax)); |
10887 | }); | 10889 | }); |
10888 | 10890 | ||
10889 | ScriptSleep(100); | 10891 | ScriptSleep(100); |
@@ -11687,7 +11689,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11687 | 11689 | ||
11688 | public static void Cache(UUID assetID, string text) | 11690 | public static void Cache(UUID assetID, string text) |
11689 | { | 11691 | { |
11690 | CacheCheck(); | 11692 | CheckCache(); |
11691 | 11693 | ||
11692 | lock (m_Notecards) | 11694 | lock (m_Notecards) |
11693 | { | 11695 | { |
@@ -11772,14 +11774,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11772 | return line; | 11774 | return line; |
11773 | } | 11775 | } |
11774 | 11776 | ||
11775 | public static void CacheCheck() | 11777 | public static void CheckCache() |
11776 | { | 11778 | { |
11777 | foreach (UUID key in new List<UUID>(m_Notecards.Keys)) | 11779 | lock (m_Notecards) |
11778 | { | 11780 | { |
11779 | Notecard nc = m_Notecards[key]; | 11781 | foreach (UUID key in new List<UUID>(m_Notecards.Keys)) |
11780 | if (nc.lastRef.AddSeconds(30) < DateTime.Now) | 11782 | { |
11781 | m_Notecards.Remove(key); | 11783 | Notecard nc = m_Notecards[key]; |
11784 | if (nc.lastRef.AddSeconds(30) < DateTime.Now) | ||
11785 | m_Notecards.Remove(key); | ||
11786 | } | ||
11782 | } | 11787 | } |
11783 | } | 11788 | } |
11784 | } | 11789 | } |
11785 | } | 11790 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs index 5b57bbe..ac9f93b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs | |||
@@ -93,7 +93,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
93 | // FIXME: This should really be a script item (with accompanying script) | 93 | // FIXME: This should really be a script item (with accompanying script) |
94 | TaskInventoryItem grp1Item | 94 | TaskInventoryItem grp1Item |
95 | = TaskInventoryHelpers.AddNotecard( | 95 | = TaskInventoryHelpers.AddNotecard( |
96 | m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900)); | 96 | m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); |
97 | grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; | 97 | grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; |
98 | 98 | ||
99 | SceneObjectGroup grp2 = SceneHelpers.CreateSceneObject(2, ownerId, "grp2-", 0x20); | 99 | SceneObjectGroup grp2 = SceneHelpers.CreateSceneObject(2, ownerId, "grp2-", 0x20); |
@@ -127,7 +127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
127 | // FIXME: This should really be a script item (with accompanying script) | 127 | // FIXME: This should really be a script item (with accompanying script) |
128 | TaskInventoryItem grp1Item | 128 | TaskInventoryItem grp1Item |
129 | = TaskInventoryHelpers.AddNotecard( | 129 | = TaskInventoryHelpers.AddNotecard( |
130 | m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900)); | 130 | m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); |
131 | 131 | ||
132 | grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; | 132 | grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; |
133 | 133 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiNotecardTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiNotecardTests.cs new file mode 100644 index 0000000..c92bcdb --- /dev/null +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiNotecardTests.cs | |||
@@ -0,0 +1,270 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.IO; | ||
4 | using System.Net; | ||
5 | using System.Reflection; | ||
6 | using System.Text; | ||
7 | using log4net; | ||
8 | using Nini.Config; | ||
9 | using NUnit.Framework; | ||
10 | using OpenMetaverse; | ||
11 | using OpenSim.Framework; | ||
12 | using OpenSim.Framework.Servers; | ||
13 | using OpenSim.Framework.Servers.HttpServer; | ||
14 | using OpenSim.Region.CoreModules.Scripting.LSLHttp; | ||
15 | using OpenSim.Region.Framework.Scenes; | ||
16 | using OpenSim.Region.ScriptEngine.Shared; | ||
17 | using OpenSim.Region.ScriptEngine.Shared.Api; | ||
18 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | ||
19 | using OpenSim.Services.Interfaces; | ||
20 | using OpenSim.Tests.Common; | ||
21 | using OpenSim.Tests.Common.Mock; | ||
22 | |||
23 | namespace OpenSim.Region.ScriptEngine.Shared.Tests | ||
24 | { | ||
25 | /// <summary> | ||
26 | /// Tests for notecard related functions in LSL | ||
27 | /// </summary> | ||
28 | [TestFixture] | ||
29 | public class LSL_ApiNotecardTests : OpenSimTestCase | ||
30 | { | ||
31 | private Scene m_scene; | ||
32 | private MockScriptEngine m_engine; | ||
33 | |||
34 | private SceneObjectGroup m_so; | ||
35 | private TaskInventoryItem m_scriptItem; | ||
36 | private LSL_Api m_lslApi; | ||
37 | |||
38 | [TestFixtureSetUp] | ||
39 | public void TestFixtureSetUp() | ||
40 | { | ||
41 | // Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread. | ||
42 | Util.FireAndForgetMethod = FireAndForgetMethod.RegressionTest; | ||
43 | } | ||
44 | |||
45 | [TestFixtureTearDown] | ||
46 | public void TestFixureTearDown() | ||
47 | { | ||
48 | // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple | ||
49 | // threads. Possibly, later tests should be rewritten so none of them require async stuff (which regression | ||
50 | // tests really shouldn't). | ||
51 | Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod; | ||
52 | } | ||
53 | |||
54 | [SetUp] | ||
55 | public override void SetUp() | ||
56 | { | ||
57 | base.SetUp(); | ||
58 | |||
59 | m_engine = new MockScriptEngine(); | ||
60 | |||
61 | m_scene = new SceneHelpers().SetupScene(); | ||
62 | SceneHelpers.SetupSceneModules(m_scene, new IniConfigSource(), m_engine); | ||
63 | |||
64 | m_so = SceneHelpers.AddSceneObject(m_scene); | ||
65 | m_scriptItem = TaskInventoryHelpers.AddScript(m_scene, m_so.RootPart); | ||
66 | |||
67 | // This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm. | ||
68 | // Possibly this could be done and we could obtain it directly from the MockScriptEngine. | ||
69 | m_lslApi = new LSL_Api(); | ||
70 | m_lslApi.Initialize(m_engine, m_so.RootPart, m_scriptItem, null); | ||
71 | } | ||
72 | |||
73 | [Test] | ||
74 | public void TestLlGetNotecardLine() | ||
75 | { | ||
76 | TestHelpers.InMethod(); | ||
77 | |||
78 | string[] ncLines = { "One", "Two", "Three" }; | ||
79 | |||
80 | TaskInventoryItem ncItem | ||
81 | = TaskInventoryHelpers.AddNotecard(m_scene, m_so.RootPart, "nc", "1", "10", string.Join("\n", ncLines)); | ||
82 | |||
83 | AssertValidNotecardLine(ncItem.Name, 0, ncLines[0]); | ||
84 | AssertValidNotecardLine(ncItem.Name, 2, ncLines[2]); | ||
85 | AssertValidNotecardLine(ncItem.Name, 3, ScriptBaseClass.EOF); | ||
86 | AssertValidNotecardLine(ncItem.Name, 4, ScriptBaseClass.EOF); | ||
87 | |||
88 | // XXX: Is this correct or do we really expect no dataserver event to fire at all? | ||
89 | AssertValidNotecardLine(ncItem.Name, -1, ""); | ||
90 | AssertValidNotecardLine(ncItem.Name, -2, ""); | ||
91 | } | ||
92 | |||
93 | [Test] | ||
94 | public void TestLlGetNotecardLine_NoNotecard() | ||
95 | { | ||
96 | TestHelpers.InMethod(); | ||
97 | |||
98 | AssertInValidNotecardLine("nc", 0); | ||
99 | } | ||
100 | |||
101 | [Test] | ||
102 | public void TestLlGetNotecardLine_NotANotecard() | ||
103 | { | ||
104 | TestHelpers.InMethod(); | ||
105 | |||
106 | TaskInventoryItem ncItem = TaskInventoryHelpers.AddScript(m_scene, m_so.RootPart, "nc1", "Not important"); | ||
107 | |||
108 | AssertInValidNotecardLine(ncItem.Name, 0); | ||
109 | } | ||
110 | |||
111 | private void AssertValidNotecardLine(string ncName, int lineNumber, string assertLine) | ||
112 | { | ||
113 | string key = m_lslApi.llGetNotecardLine(ncName, lineNumber); | ||
114 | Assert.That(key, Is.Not.EqualTo(UUID.Zero.ToString())); | ||
115 | |||
116 | Assert.That(m_engine.PostedEvents.Count, Is.EqualTo(1)); | ||
117 | Assert.That(m_engine.PostedEvents.ContainsKey(m_scriptItem.ItemID)); | ||
118 | |||
119 | List<EventParams> events = m_engine.PostedEvents[m_scriptItem.ItemID]; | ||
120 | Assert.That(events.Count, Is.EqualTo(1)); | ||
121 | EventParams eventParams = events[0]; | ||
122 | |||
123 | Assert.That(eventParams.EventName, Is.EqualTo("dataserver")); | ||
124 | Assert.That(eventParams.Params[0].ToString(), Is.EqualTo(key)); | ||
125 | Assert.That(eventParams.Params[1].ToString(), Is.EqualTo(assertLine)); | ||
126 | |||
127 | m_engine.ClearPostedEvents(); | ||
128 | } | ||
129 | |||
130 | private void AssertInValidNotecardLine(string ncName, int lineNumber) | ||
131 | { | ||
132 | string key = m_lslApi.llGetNotecardLine(ncName, lineNumber); | ||
133 | Assert.That(key, Is.EqualTo(UUID.Zero.ToString())); | ||
134 | |||
135 | Assert.That(m_engine.PostedEvents.Count, Is.EqualTo(0)); | ||
136 | } | ||
137 | |||
138 | // [Test] | ||
139 | // public void TestLlReleaseUrl() | ||
140 | // { | ||
141 | // TestHelpers.InMethod(); | ||
142 | // | ||
143 | // m_lslApi.llRequestURL(); | ||
144 | // string returnedUri = m_engine.PostedEvents[m_scriptItem.ItemID][0].Params[2].ToString(); | ||
145 | // | ||
146 | // { | ||
147 | // // Check that the initial number of URLs is correct | ||
148 | // Assert.That(m_lslApi.llGetFreeURLs().value, Is.EqualTo(m_urlModule.TotalUrls - 1)); | ||
149 | // } | ||
150 | // | ||
151 | // { | ||
152 | // // Check releasing a non-url | ||
153 | // m_lslApi.llReleaseURL("GARBAGE"); | ||
154 | // Assert.That(m_lslApi.llGetFreeURLs().value, Is.EqualTo(m_urlModule.TotalUrls - 1)); | ||
155 | // } | ||
156 | // | ||
157 | // { | ||
158 | // // Check releasing a non-existing url | ||
159 | // m_lslApi.llReleaseURL("http://example.com"); | ||
160 | // Assert.That(m_lslApi.llGetFreeURLs().value, Is.EqualTo(m_urlModule.TotalUrls - 1)); | ||
161 | // } | ||
162 | // | ||
163 | // { | ||
164 | // // Check URL release | ||
165 | // m_lslApi.llReleaseURL(returnedUri); | ||
166 | // Assert.That(m_lslApi.llGetFreeURLs().value, Is.EqualTo(m_urlModule.TotalUrls)); | ||
167 | // | ||
168 | // HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(returnedUri); | ||
169 | // | ||
170 | // bool gotExpectedException = false; | ||
171 | // | ||
172 | // try | ||
173 | // { | ||
174 | // using (HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse()) | ||
175 | // {} | ||
176 | // } | ||
177 | // catch (WebException e) | ||
178 | // { | ||
179 | // using (HttpWebResponse response = (HttpWebResponse)e.Response) | ||
180 | // gotExpectedException = response.StatusCode == HttpStatusCode.NotFound; | ||
181 | // } | ||
182 | // | ||
183 | // Assert.That(gotExpectedException, Is.True); | ||
184 | // } | ||
185 | // | ||
186 | // { | ||
187 | // // Check releasing the same URL again | ||
188 | // m_lslApi.llReleaseURL(returnedUri); | ||
189 | // Assert.That(m_lslApi.llGetFreeURLs().value, Is.EqualTo(m_urlModule.TotalUrls)); | ||
190 | // } | ||
191 | // } | ||
192 | // | ||
193 | // [Test] | ||
194 | // public void TestLlRequestUrl() | ||
195 | // { | ||
196 | // TestHelpers.InMethod(); | ||
197 | // | ||
198 | // string requestId = m_lslApi.llRequestURL(); | ||
199 | // Assert.That(requestId, Is.Not.EqualTo(UUID.Zero.ToString())); | ||
200 | // string returnedUri; | ||
201 | // | ||
202 | // { | ||
203 | // // Check that URL is correctly set up | ||
204 | // Assert.That(m_lslApi.llGetFreeURLs().value, Is.EqualTo(m_urlModule.TotalUrls - 1)); | ||
205 | // | ||
206 | // Assert.That(m_engine.PostedEvents.ContainsKey(m_scriptItem.ItemID)); | ||
207 | // | ||
208 | // List<EventParams> events = m_engine.PostedEvents[m_scriptItem.ItemID]; | ||
209 | // Assert.That(events.Count, Is.EqualTo(1)); | ||
210 | // EventParams eventParams = events[0]; | ||
211 | // Assert.That(eventParams.EventName, Is.EqualTo("http_request")); | ||
212 | // | ||
213 | // UUID returnKey; | ||
214 | // string rawReturnKey = eventParams.Params[0].ToString(); | ||
215 | // string method = eventParams.Params[1].ToString(); | ||
216 | // returnedUri = eventParams.Params[2].ToString(); | ||
217 | // | ||
218 | // Assert.That(UUID.TryParse(rawReturnKey, out returnKey), Is.True); | ||
219 | // Assert.That(method, Is.EqualTo(ScriptBaseClass.URL_REQUEST_GRANTED)); | ||
220 | // Assert.That(Uri.IsWellFormedUriString(returnedUri, UriKind.Absolute), Is.True); | ||
221 | // } | ||
222 | // | ||
223 | // { | ||
224 | // // Check that request to URL works. | ||
225 | // string testResponse = "Hello World"; | ||
226 | // | ||
227 | // m_engine.ClearPostedEvents(); | ||
228 | // m_engine.PostEventHook | ||
229 | // += (itemId, evp) => m_lslApi.llHTTPResponse(evp.Params[0].ToString(), 200, testResponse); | ||
230 | // | ||
231 | //// Console.WriteLine("Trying {0}", returnedUri); | ||
232 | // HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(returnedUri); | ||
233 | // | ||
234 | // AssertHttpResponse(returnedUri, testResponse); | ||
235 | // | ||
236 | // Assert.That(m_engine.PostedEvents.ContainsKey(m_scriptItem.ItemID)); | ||
237 | // | ||
238 | // List<EventParams> events = m_engine.PostedEvents[m_scriptItem.ItemID]; | ||
239 | // Assert.That(events.Count, Is.EqualTo(1)); | ||
240 | // EventParams eventParams = events[0]; | ||
241 | // Assert.That(eventParams.EventName, Is.EqualTo("http_request")); | ||
242 | // | ||
243 | // UUID returnKey; | ||
244 | // string rawReturnKey = eventParams.Params[0].ToString(); | ||
245 | // string method = eventParams.Params[1].ToString(); | ||
246 | // string body = eventParams.Params[2].ToString(); | ||
247 | // | ||
248 | // Assert.That(UUID.TryParse(rawReturnKey, out returnKey), Is.True); | ||
249 | // Assert.That(method, Is.EqualTo("GET")); | ||
250 | // Assert.That(body, Is.EqualTo("")); | ||
251 | // } | ||
252 | // } | ||
253 | // | ||
254 | // private void AssertHttpResponse(string uri, string expectedResponse) | ||
255 | // { | ||
256 | // HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(uri); | ||
257 | // | ||
258 | // using (HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse()) | ||
259 | // { | ||
260 | // using (Stream stream = webResponse.GetResponseStream()) | ||
261 | // { | ||
262 | // using (StreamReader reader = new StreamReader(stream)) | ||
263 | // { | ||
264 | // Assert.That(reader.ReadToEnd(), Is.EqualTo(expectedResponse)); | ||
265 | // } | ||
266 | // } | ||
267 | // } | ||
268 | // } | ||
269 | } | ||
270 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs index b2803a1..e422f5b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs | |||
@@ -151,7 +151,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
151 | 151 | ||
152 | // Create an object embedded inside the first | 152 | // Create an object embedded inside the first |
153 | TaskInventoryHelpers.AddNotecard( | 153 | TaskInventoryHelpers.AddNotecard( |
154 | m_scene, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, TestHelpers.ParseTail(0x900)); | 154 | m_scene, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, TestHelpers.ParseTail(0x900), "Hello World!"); |
155 | 155 | ||
156 | bool exceptionCaught = false; | 156 | bool exceptionCaught = false; |
157 | 157 | ||