diff options
author | Justin Clark-Casey (justincc) | 2012-05-14 18:33:20 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-05-14 18:33:20 +0100 |
commit | 42557d7d4c145030dceb2b42bd4c0e7bd22c930d (patch) | |
tree | 289418b2630b51507b94e5b4830764c3a5b62cb4 /OpenSim/Region | |
parent | Add more region information to some teleport related logging (diff) | |
parent | Oops - missed the config changes (diff) | |
download | opensim-SC-42557d7d4c145030dceb2b42bd4c0e7bd22c930d.zip opensim-SC-42557d7d4c145030dceb2b42bd4c0e7bd22c930d.tar.gz opensim-SC-42557d7d4c145030dceb2b42bd4c0e7bd22c930d.tar.bz2 opensim-SC-42557d7d4c145030dceb2b42bd4c0e7bd22c930d.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
4 files changed, 172 insertions, 64 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index 9255791..e91e8b9 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | |||
@@ -64,6 +64,8 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
64 | private TimeSpan m_QueueTimeout = new TimeSpan(2, 0, 0); // 2 hours without llGetNextEmail drops the queue | 64 | private TimeSpan m_QueueTimeout = new TimeSpan(2, 0, 0); // 2 hours without llGetNextEmail drops the queue |
65 | private string m_InterObjectHostname = "lsl.opensim.local"; | 65 | private string m_InterObjectHostname = "lsl.opensim.local"; |
66 | 66 | ||
67 | private int m_MaxEmailSize = 4096; // largest email allowed by default, as per lsl docs. | ||
68 | |||
67 | // Scenes by Region Handle | 69 | // Scenes by Region Handle |
68 | private Dictionary<ulong, Scene> m_Scenes = | 70 | private Dictionary<ulong, Scene> m_Scenes = |
69 | new Dictionary<ulong, Scene>(); | 71 | new Dictionary<ulong, Scene>(); |
@@ -127,6 +129,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
127 | SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); | 129 | SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); |
128 | SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); | 130 | SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); |
129 | SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); | 131 | SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); |
132 | m_MaxEmailSize = SMTPConfig.GetInt("email_max_size", m_MaxEmailSize); | ||
130 | } | 133 | } |
131 | catch (Exception e) | 134 | catch (Exception e) |
132 | { | 135 | { |
@@ -176,18 +179,6 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
176 | get { return true; } | 179 | get { return true; } |
177 | } | 180 | } |
178 | 181 | ||
179 | /// <summary> | ||
180 | /// Delay function using thread in seconds | ||
181 | /// </summary> | ||
182 | /// <param name="seconds"></param> | ||
183 | private void DelayInSeconds(int delay) | ||
184 | { | ||
185 | delay = (int)((float)delay * 1000); | ||
186 | if (delay == 0) | ||
187 | return; | ||
188 | System.Threading.Thread.Sleep(delay); | ||
189 | } | ||
190 | |||
191 | private bool IsLocal(UUID objectID) | 182 | private bool IsLocal(UUID objectID) |
192 | { | 183 | { |
193 | string unused; | 184 | string unused; |
@@ -267,10 +258,9 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
267 | m_log.Error("[EMAIL] REGEX Problem in EMail Address: "+address); | 258 | m_log.Error("[EMAIL] REGEX Problem in EMail Address: "+address); |
268 | return; | 259 | return; |
269 | } | 260 | } |
270 | //FIXME:Check if subject + body = 4096 Byte | 261 | if ((subject.Length + body.Length) > m_MaxEmailSize) |
271 | if ((subject.Length + body.Length) > 1024) | ||
272 | { | 262 | { |
273 | m_log.Error("[EMAIL] subject + body > 1024 Byte"); | 263 | m_log.Error("[EMAIL] subject + body larger than limit of " + m_MaxEmailSize + " bytes"); |
274 | return; | 264 | return; |
275 | } | 265 | } |
276 | 266 | ||
@@ -345,10 +335,6 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
345 | // TODO FIX | 335 | // TODO FIX |
346 | } | 336 | } |
347 | } | 337 | } |
348 | |||
349 | //DONE: Message as Second Life style | ||
350 | //20 second delay - AntiSpam System - for now only 10 seconds | ||
351 | DelayInSeconds(10); | ||
352 | } | 338 | } |
353 | 339 | ||
354 | /// <summary> | 340 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3d2213a..2a2830f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -569,6 +569,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
569 | get { return m_sceneGraph.Entities; } | 569 | get { return m_sceneGraph.Entities; } |
570 | } | 570 | } |
571 | 571 | ||
572 | // can be closest/random/sequence | ||
573 | private string m_SpawnPointRouting = "closest"; | ||
574 | // used in sequence see: SpawnPoint() | ||
575 | private int m_SpawnPoint; | ||
576 | public string SpawnPointRouting | ||
577 | { | ||
578 | get { return m_SpawnPointRouting; } | ||
579 | } | ||
580 | |||
572 | #endregion Properties | 581 | #endregion Properties |
573 | 582 | ||
574 | #region Constructors | 583 | #region Constructors |
@@ -586,7 +595,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
586 | 595 | ||
587 | Random random = new Random(); | 596 | Random random = new Random(); |
588 | 597 | ||
589 | m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue/2))+(uint)(uint.MaxValue/4); | 598 | m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4); |
590 | m_moduleLoader = moduleLoader; | 599 | m_moduleLoader = moduleLoader; |
591 | m_authenticateHandler = authen; | 600 | m_authenticateHandler = authen; |
592 | m_sceneGridService = sceneGridService; | 601 | m_sceneGridService = sceneGridService; |
@@ -678,7 +687,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
678 | { | 687 | { |
679 | IConfig startupConfig = m_config.Configs["Startup"]; | 688 | IConfig startupConfig = m_config.Configs["Startup"]; |
680 | 689 | ||
681 | m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance); | 690 | m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance); |
682 | m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup); | 691 | m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup); |
683 | if (!m_useBackup) | 692 | if (!m_useBackup) |
684 | m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName); | 693 | m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName); |
@@ -711,7 +720,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
711 | m_clampPrimSize = true; | 720 | m_clampPrimSize = true; |
712 | } | 721 | } |
713 | 722 | ||
714 | m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete",m_useTrashOnDelete); | 723 | m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete", m_useTrashOnDelete); |
715 | m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries); | 724 | m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries); |
716 | m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings); | 725 | m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings); |
717 | m_dontPersistBefore = | 726 | m_dontPersistBefore = |
@@ -723,6 +732,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
723 | 732 | ||
724 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine"); | 733 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine"); |
725 | 734 | ||
735 | m_SpawnPointRouting = startupConfig.GetString("SpawnPointRouting", "closest"); | ||
736 | |||
726 | IConfig packetConfig = m_config.Configs["PacketPool"]; | 737 | IConfig packetConfig = m_config.Configs["PacketPool"]; |
727 | if (packetConfig != null) | 738 | if (packetConfig != null) |
728 | { | 739 | { |
@@ -3389,7 +3400,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3389 | public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup) | 3400 | public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup) |
3390 | { | 3401 | { |
3391 | bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 || | 3402 | bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 || |
3392 | (teleportFlags & (uint)TPFlags.ViaHGLogin) != 0); | 3403 | (teleportFlags & (uint)TPFlags.ViaHGLogin) != 0); |
3393 | bool viahome = ((teleportFlags & (uint)TPFlags.ViaHome) != 0); | 3404 | bool viahome = ((teleportFlags & (uint)TPFlags.ViaHome) != 0); |
3394 | bool godlike = ((teleportFlags & (uint)TPFlags.Godlike) != 0); | 3405 | bool godlike = ((teleportFlags & (uint)TPFlags.Godlike) != 0); |
3395 | 3406 | ||
@@ -3405,8 +3416,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
3405 | // Don't disable this log message - it's too helpful | 3416 | // Don't disable this log message - it's too helpful |
3406 | m_log.DebugFormat( | 3417 | m_log.DebugFormat( |
3407 | "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9})", | 3418 | "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9})", |
3408 | RegionInfo.RegionName, (agent.child ? "child" : "root"),agent.firstname, agent.lastname, | 3419 | RegionInfo.RegionName, |
3409 | agent.AgentID, agent.circuitcode, agent.IPAddress, agent.Viewer, ((TPFlags)teleportFlags).ToString(), agent.startpos); | 3420 | (agent.child ? "child" : "root"), |
3421 | agent.firstname, | ||
3422 | agent.lastname, | ||
3423 | agent.AgentID, | ||
3424 | agent.circuitcode, | ||
3425 | agent.IPAddress, | ||
3426 | agent.Viewer, | ||
3427 | ((TPFlags)teleportFlags).ToString(), | ||
3428 | agent.startpos | ||
3429 | ); | ||
3410 | 3430 | ||
3411 | if (LoginsDisabled) | 3431 | if (LoginsDisabled) |
3412 | { | 3432 | { |
@@ -3421,7 +3441,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3421 | // We have a zombie from a crashed session. | 3441 | // We have a zombie from a crashed session. |
3422 | // Or the same user is trying to be root twice here, won't work. | 3442 | // Or the same user is trying to be root twice here, won't work. |
3423 | // Kill it. | 3443 | // Kill it. |
3424 | m_log.DebugFormat("[SCENE]: Zombie scene presence detected for {0} in {1}", agent.AgentID, RegionInfo.RegionName); | 3444 | m_log.DebugFormat( |
3445 | "[SCENE]: Zombie scene presence detected for {0} in {1}", | ||
3446 | agent.AgentID, | ||
3447 | RegionInfo.RegionName | ||
3448 | ); | ||
3425 | sp.ControllingClient.Close(); | 3449 | sp.ControllingClient.Close(); |
3426 | sp = null; | 3450 | sp = null; |
3427 | } | 3451 | } |
@@ -3445,8 +3469,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3445 | { | 3469 | { |
3446 | if (!VerifyUserPresence(agent, out reason)) | 3470 | if (!VerifyUserPresence(agent, out reason)) |
3447 | return false; | 3471 | return false; |
3448 | } | 3472 | } catch (Exception e) |
3449 | catch (Exception e) | ||
3450 | { | 3473 | { |
3451 | m_log.ErrorFormat( | 3474 | m_log.ErrorFormat( |
3452 | "[SCENE]: Exception verifying presence {0}{1}", e.Message, e.StackTrace); | 3475 | "[SCENE]: Exception verifying presence {0}{1}", e.Message, e.StackTrace); |
@@ -3458,8 +3481,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3458 | { | 3481 | { |
3459 | if (!AuthorizeUser(agent, out reason)) | 3482 | if (!AuthorizeUser(agent, out reason)) |
3460 | return false; | 3483 | return false; |
3461 | } | 3484 | } catch (Exception e) |
3462 | catch (Exception e) | ||
3463 | { | 3485 | { |
3464 | m_log.ErrorFormat( | 3486 | m_log.ErrorFormat( |
3465 | "[SCENE]: Exception authorizing user {0}{1}", e.Message, e.StackTrace); | 3487 | "[SCENE]: Exception authorizing user {0}{1}", e.Message, e.StackTrace); |
@@ -3476,8 +3498,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3476 | CapsModule.SetAgentCapsSeeds(agent); | 3498 | CapsModule.SetAgentCapsSeeds(agent); |
3477 | CapsModule.CreateCaps(agent.AgentID); | 3499 | CapsModule.CreateCaps(agent.AgentID); |
3478 | } | 3500 | } |
3479 | } | 3501 | } else |
3480 | else | ||
3481 | { | 3502 | { |
3482 | // Let the SP know how we got here. This has a lot of interesting | 3503 | // Let the SP know how we got here. This has a lot of interesting |
3483 | // uses down the line. | 3504 | // uses down the line. |
@@ -3500,7 +3521,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3500 | agent.teleportFlags = teleportFlags; | 3521 | agent.teleportFlags = teleportFlags; |
3501 | m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); | 3522 | m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); |
3502 | 3523 | ||
3503 | if (vialogin) | 3524 | if (vialogin) |
3504 | { | 3525 | { |
3505 | // CleanDroppedAttachments(); | 3526 | // CleanDroppedAttachments(); |
3506 | 3527 | ||
@@ -3541,8 +3562,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3541 | agent.startpos.Z = 720; | 3562 | agent.startpos.Z = 720; |
3542 | } | 3563 | } |
3543 | } | 3564 | } |
3544 | } | 3565 | } else |
3545 | else | ||
3546 | { | 3566 | { |
3547 | if (agent.startpos.X > EastBorders[0].BorderLine.Z) | 3567 | if (agent.startpos.X > EastBorders[0].BorderLine.Z) |
3548 | { | 3568 | { |
@@ -3568,10 +3588,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
3568 | SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject); | 3588 | SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject); |
3569 | // Can have multiple SpawnPoints | 3589 | // Can have multiple SpawnPoints |
3570 | List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints(); | 3590 | List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints(); |
3571 | if ( spawnpoints.Count > 1) | 3591 | if (spawnpoints.Count > 1) |
3572 | { | 3592 | { |
3573 | // We have multiple SpawnPoints, Route the agent to a random one | 3593 | // We have multiple SpawnPoints, Route the agent to a random or sequential one |
3574 | agent.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count)].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); | 3594 | if (SpawnPointRouting == "random") |
3595 | agent.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count) - 1].GetLocation( | ||
3596 | telehub.AbsolutePosition, | ||
3597 | telehub.GroupRotation | ||
3598 | ); | ||
3599 | else | ||
3600 | agent.startpos = spawnpoints[SpawnPoint()].GetLocation( | ||
3601 | telehub.AbsolutePosition, | ||
3602 | telehub.GroupRotation | ||
3603 | ); | ||
3575 | } | 3604 | } |
3576 | else | 3605 | else |
3577 | { | 3606 | { |
@@ -5257,5 +5286,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
5257 | } | 5286 | } |
5258 | } | 5287 | } |
5259 | } | 5288 | } |
5289 | |||
5290 | // manage and select spawn points in sequence | ||
5291 | public int SpawnPoint() | ||
5292 | { | ||
5293 | int spawnpoints = RegionInfo.RegionSettings.SpawnPoints().Count; | ||
5294 | |||
5295 | if (spawnpoints == 0) | ||
5296 | return 0; | ||
5297 | |||
5298 | m_SpawnPoint++; | ||
5299 | if (m_SpawnPoint > spawnpoints) | ||
5300 | m_SpawnPoint = 1; | ||
5301 | return m_SpawnPoint - 1; | ||
5302 | } | ||
5260 | } | 5303 | } |
5261 | } | 5304 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b737f91..bdcef71 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3934,28 +3934,93 @@ namespace OpenSim.Region.Framework.Scenes | |||
3934 | if (spawnPoints.Length == 0) | 3934 | if (spawnPoints.Length == 0) |
3935 | return; | 3935 | return; |
3936 | 3936 | ||
3937 | float distance = 9999; | 3937 | int index; |
3938 | int closest = -1; | 3938 | bool selected = false; |
3939 | 3939 | ||
3940 | for (int i = 0 ; i < spawnPoints.Length ; i++) | 3940 | switch (m_scene.SpawnPointRouting) |
3941 | { | 3941 | { |
3942 | Vector3 spawnPosition = spawnPoints[i].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); | 3942 | case "closest": |
3943 | Vector3 offset = spawnPosition - pos; | ||
3944 | float d = Vector3.Mag(offset); | ||
3945 | if (d >= distance) | ||
3946 | continue; | ||
3947 | ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y); | ||
3948 | if (land == null) | ||
3949 | continue; | ||
3950 | if (land.IsEitherBannedOrRestricted(UUID)) | ||
3951 | continue; | ||
3952 | distance = d; | ||
3953 | closest = i; | ||
3954 | } | ||
3955 | if (closest == -1) | ||
3956 | return; | ||
3957 | 3943 | ||
3958 | pos = spawnPoints[closest].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); | 3944 | float distance = 9999; |
3945 | int closest = -1; | ||
3946 | |||
3947 | for (int i = 0; i < spawnPoints.Length; i++) | ||
3948 | { | ||
3949 | Vector3 spawnPosition = spawnPoints[i].GetLocation( | ||
3950 | telehub.AbsolutePosition, | ||
3951 | telehub.GroupRotation | ||
3952 | ); | ||
3953 | Vector3 offset = spawnPosition - pos; | ||
3954 | float d = Vector3.Mag(offset); | ||
3955 | if (d >= distance) | ||
3956 | continue; | ||
3957 | ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y); | ||
3958 | if (land == null) | ||
3959 | continue; | ||
3960 | if (land.IsEitherBannedOrRestricted(UUID)) | ||
3961 | continue; | ||
3962 | distance = d; | ||
3963 | closest = i; | ||
3964 | } | ||
3965 | if (closest == -1) | ||
3966 | return; | ||
3967 | |||
3968 | pos = spawnPoints[closest].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); | ||
3969 | return; | ||
3970 | |||
3971 | case "random": | ||
3972 | |||
3973 | do | ||
3974 | { | ||
3975 | index = Util.RandomClass.Next(spawnPoints.Length - 1); | ||
3976 | |||
3977 | Vector3 spawnPosition = spawnPoints[index].GetLocation( | ||
3978 | telehub.AbsolutePosition, | ||
3979 | telehub.GroupRotation | ||
3980 | ); | ||
3981 | // SpawnPoint sp = spawnPoints[index]; | ||
3982 | |||
3983 | ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y); | ||
3984 | if (land == null || land.IsEitherBannedOrRestricted(UUID)) | ||
3985 | selected = false; | ||
3986 | else | ||
3987 | selected = true; | ||
3988 | |||
3989 | } while ( selected == false); | ||
3990 | |||
3991 | pos = spawnPoints[index].GetLocation( | ||
3992 | telehub.AbsolutePosition, | ||
3993 | telehub.GroupRotation | ||
3994 | ); | ||
3995 | return; | ||
3996 | |||
3997 | case "sequence": | ||
3998 | |||
3999 | do | ||
4000 | { | ||
4001 | index = m_scene.SpawnPoint(); | ||
4002 | |||
4003 | Vector3 spawnPosition = spawnPoints[index].GetLocation( | ||
4004 | telehub.AbsolutePosition, | ||
4005 | telehub.GroupRotation | ||
4006 | ); | ||
4007 | // SpawnPoint sp = spawnPoints[index]; | ||
4008 | |||
4009 | ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y); | ||
4010 | if (land == null || land.IsEitherBannedOrRestricted(UUID)) | ||
4011 | selected = false; | ||
4012 | else | ||
4013 | selected = true; | ||
4014 | |||
4015 | } while (selected == false); | ||
4016 | |||
4017 | pos = spawnPoints[index].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); | ||
4018 | ; | ||
4019 | return; | ||
4020 | |||
4021 | default: | ||
4022 | return; | ||
4023 | } | ||
3959 | } | 4024 | } |
3960 | } | 4025 | } |
3961 | } | 4026 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5b5cab8..5bff2e9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -106,6 +106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
106 | protected IUrlModule m_UrlModule = null; | 106 | protected IUrlModule m_UrlModule = null; |
107 | protected Dictionary<UUID, UserInfoCacheEntry> m_userInfoCache = | 107 | protected Dictionary<UUID, UserInfoCacheEntry> m_userInfoCache = |
108 | new Dictionary<UUID, UserInfoCacheEntry>(); | 108 | new Dictionary<UUID, UserInfoCacheEntry>(); |
109 | protected int EMAIL_PAUSE_TIME = 20; // documented delay value for smtp. | ||
109 | 110 | ||
110 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) | 111 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) |
111 | { | 112 | { |
@@ -113,6 +114,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
113 | m_host = host; | 114 | m_host = host; |
114 | m_item = item; | 115 | m_item = item; |
115 | 116 | ||
117 | LoadLimits(); // read script limits from config. | ||
118 | |||
119 | m_TransferModule = | ||
120 | m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>(); | ||
121 | m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); | ||
122 | |||
123 | AsyncCommands = new AsyncCommandManager(ScriptEngine); | ||
124 | } | ||
125 | |||
126 | /* load configuration items that affect script, object and run-time behavior. */ | ||
127 | private void LoadLimits() | ||
128 | { | ||
116 | m_ScriptDelayFactor = | 129 | m_ScriptDelayFactor = |
117 | m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f); | 130 | m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f); |
118 | m_ScriptDistanceFactor = | 131 | m_ScriptDistanceFactor = |
@@ -125,12 +138,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
125 | m_ScriptEngine.Config.GetInt("NotecardLineReadCharsMax", 255); | 138 | m_ScriptEngine.Config.GetInt("NotecardLineReadCharsMax", 255); |
126 | if (m_notecardLineReadCharsMax > 65535) | 139 | if (m_notecardLineReadCharsMax > 65535) |
127 | m_notecardLineReadCharsMax = 65535; | 140 | m_notecardLineReadCharsMax = 65535; |
128 | 141 | // load limits for particular subsystems. | |
129 | m_TransferModule = | 142 | IConfig SMTPConfig; |
130 | m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>(); | 143 | if ((SMTPConfig = m_ScriptEngine.ConfigSource.Configs["SMTP"]) != null) { |
131 | m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); | 144 | // there's an smtp config, so load in the snooze time. |
132 | 145 | EMAIL_PAUSE_TIME = SMTPConfig.GetInt("email_pause_time", EMAIL_PAUSE_TIME); | |
133 | AsyncCommands = new AsyncCommandManager(ScriptEngine); | 146 | } |
134 | } | 147 | } |
135 | 148 | ||
136 | public override Object InitializeLifetimeService() | 149 | public override Object InitializeLifetimeService() |
@@ -2877,6 +2890,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2877 | 2890 | ||
2878 | public virtual void llSleep(double sec) | 2891 | public virtual void llSleep(double sec) |
2879 | { | 2892 | { |
2893 | // m_log.Info("llSleep snoozing " + sec + "s."); | ||
2880 | m_host.AddScriptLPS(1); | 2894 | m_host.AddScriptLPS(1); |
2881 | Thread.Sleep((int)(sec * 1000)); | 2895 | Thread.Sleep((int)(sec * 1000)); |
2882 | } | 2896 | } |
@@ -3130,7 +3144,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3130 | } | 3144 | } |
3131 | 3145 | ||
3132 | emailModule.SendEmail(m_host.UUID, address, subject, message); | 3146 | emailModule.SendEmail(m_host.UUID, address, subject, message); |
3133 | ScriptSleep(20000); | 3147 | llSleep(EMAIL_PAUSE_TIME); |
3134 | } | 3148 | } |
3135 | 3149 | ||
3136 | public void llGetNextEmail(string address, string subject) | 3150 | public void llGetNextEmail(string address, string subject) |