aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs18
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs13
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs40
4 files changed, 60 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 7ce3716..26ef0dd 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2311,5 +2311,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2311 }); 2311 });
2312 return result; 2312 return result;
2313 } 2313 }
2314
2315 /// <summary>
2316 /// Convert a unix time to a llGetTimestamp() like string
2317 /// </summary>
2318 /// <param name="unixTime"></param>
2319 /// <returns></returns>
2320 public LSL_String osUnixTimeToTimestamp(long time)
2321 {
2322 CheckThreatLevel(ThreatLevel.VeryLow, "osUnixTimeToTimestamp");
2323 long baseTicks = 621355968000000000;
2324 long tickResolution = 10000000;
2325 long epochTicks = (time * tickResolution) + baseTicks;
2326 DateTime date = new DateTime(epochTicks);
2327
2328 return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ");
2329 }
2314 } 2330 }
2315} 2331} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 028bb42..961987d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -184,5 +184,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
184 184
185 LSL_List osGetAvatarList(); 185 LSL_List osGetAvatarList();
186 186
187 LSL_String osUnixTimeToTimestamp(long time);
187 } 188 }
188} 189}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 370bf1d..f3142e6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -678,26 +678,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
678 { 678 {
679 return m_OSSL_Functions.osGetSimulatorMemory(); 679 return m_OSSL_Functions.osGetSimulatorMemory();
680 } 680 }
681
681 public void osKickAvatar(string FirstName,string SurName,string alert) 682 public void osKickAvatar(string FirstName,string SurName,string alert)
682 { 683 {
683 m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert); 684 m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert);
684 } 685 }
686
685 public void osSetSpeed(string UUID, float SpeedModifier) 687 public void osSetSpeed(string UUID, float SpeedModifier)
686 { 688 {
687 m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier); 689 m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier);
688 } 690 }
691
689 public void osCauseDamage(string avatar, double damage) 692 public void osCauseDamage(string avatar, double damage)
690 { 693 {
691 m_OSSL_Functions.osCauseDamage(avatar, damage); 694 m_OSSL_Functions.osCauseDamage(avatar, damage);
692 } 695 }
696
693 public void osCauseHealing(string avatar, double healing) 697 public void osCauseHealing(string avatar, double healing)
694 { 698 {
695 m_OSSL_Functions.osCauseHealing(avatar, healing); 699 m_OSSL_Functions.osCauseHealing(avatar, healing);
696 } 700 }
701
697 public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules) 702 public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules)
698 { 703 {
699 return m_OSSL_Functions.osGetPrimitiveParams(prim, rules); 704 return m_OSSL_Functions.osGetPrimitiveParams(prim, rules);
700 } 705 }
706
701 public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) 707 public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
702 { 708 {
703 m_OSSL_Functions.osSetPrimitiveParams(prim, rules); 709 m_OSSL_Functions.osSetPrimitiveParams(prim, rules);
@@ -717,5 +723,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
717 { 723 {
718 return m_OSSL_Functions.osGetAvatarList(); 724 return m_OSSL_Functions.osGetAvatarList();
719 } 725 }
726
727 public LSL_String osUnixTimeToTimestamp(long time)
728 {
729 return m_OSSL_Functions.osUnixTimeToTimestamp(time);
730 }
720 } 731 }
721} 732} \ No newline at end of file
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 1d3c412..35adf0f 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Linq;
31using System.Net; 32using System.Net;
32using System.Reflection; 33using System.Reflection;
33using System.Text.RegularExpressions; 34using System.Text.RegularExpressions;
@@ -433,12 +434,9 @@ namespace OpenSim.Services.LLLoginService
433 { 434 {
434 m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a valid home and this grid does not have default locations. Attempting to find random region", 435 m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a valid home and this grid does not have default locations. Attempting to find random region",
435 account.FirstName, account.LastName); 436 account.FirstName, account.LastName);
436 defaults = m_GridService.GetRegionsByName(scopeID, "", 1); 437 region = FindAlternativeRegion(scopeID);
437 if (defaults != null && defaults.Count > 0) 438 if (region != null)
438 {
439 region = defaults[0];
440 where = "safe"; 439 where = "safe";
441 }
442 } 440 }
443 } 441 }
444 442
@@ -465,12 +463,9 @@ namespace OpenSim.Services.LLLoginService
465 else 463 else
466 { 464 {
467 m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region"); 465 m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region");
468 defaults = m_GridService.GetRegionsByName(scopeID, "", 1); 466 region = FindAlternativeRegion(scopeID);
469 if (defaults != null && defaults.Count > 0) 467 if (region != null)
470 {
471 region = defaults[0];
472 where = "safe"; 468 where = "safe";
473 }
474 } 469 }
475 470
476 } 471 }
@@ -570,6 +565,31 @@ namespace OpenSim.Services.LLLoginService
570 565
571 } 566 }
572 567
568 private GridRegion FindAlternativeRegion(UUID scopeID)
569 {
570 List<GridRegion> hyperlinks = null;
571 List<GridRegion> regions = m_GridService.GetFallbackRegions(scopeID, 1000 * (int)Constants.RegionSize, 1000 * (int)Constants.RegionSize);
572 if (regions != null && regions.Count > 0)
573 {
574 hyperlinks = m_GridService.GetHyperlinks(scopeID);
575 IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
576 if (availableRegions.Count() > 0)
577 return availableRegions.ElementAt(0);
578 }
579 // No fallbacks, try to find an arbitrary region that is not a hyperlink
580 // maxNumber is fixed for now; maybe use some search pattern with increasing maxSize here?
581 regions = m_GridService.GetRegionsByName(scopeID, "", 10);
582 if (regions != null && regions.Count > 0)
583 {
584 if (hyperlinks == null)
585 hyperlinks = m_GridService.GetHyperlinks(scopeID);
586 IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
587 if (availableRegions.Count() > 0)
588 return availableRegions.ElementAt(0);
589 }
590 return null;
591 }
592
573 private GridRegion FindForeignRegion(string domainName, uint port, string regionName, out GridRegion gatekeeper) 593 private GridRegion FindForeignRegion(string domainName, uint port, string regionName, out GridRegion gatekeeper)
574 { 594 {
575 gatekeeper = new GridRegion(); 595 gatekeeper = new GridRegion();