diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs index 0f2d2a5..cfd70f4 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs | |||
@@ -524,7 +524,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
524 | { | 524 | { |
525 | m_host.AddScriptLPS(1); | 525 | m_host.AddScriptLPS(1); |
526 | LLUUID sensedUUID = m_ScriptEngine.GetDetectID(m_itemID, number); | 526 | LLUUID sensedUUID = m_ScriptEngine.GetDetectID(m_itemID, number); |
527 | if (sensedUUID != null) | 527 | if (sensedUUID != LLUUID.Zero) |
528 | return resolveName(sensedUUID); | 528 | return resolveName(sensedUUID); |
529 | return String.Empty; | 529 | return String.Empty; |
530 | } | 530 | } |
@@ -537,7 +537,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
537 | public EntityBase entityDetectedKey(int number) | 537 | public EntityBase entityDetectedKey(int number) |
538 | { | 538 | { |
539 | LLUUID sensedUUID = m_ScriptEngine.GetDetectID(m_itemID, number); | 539 | LLUUID sensedUUID = m_ScriptEngine.GetDetectID(m_itemID, number); |
540 | if (sensedUUID != null) | 540 | if (sensedUUID != LLUUID.Zero) |
541 | { | 541 | { |
542 | EntityBase SensedObject = null; | 542 | EntityBase SensedObject = null; |
543 | lock (World.Entities) | 543 | lock (World.Entities) |
@@ -636,6 +636,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
636 | { | 636 | { |
637 | m_host.AddScriptLPS(1); | 637 | m_host.AddScriptLPS(1); |
638 | XDetectParams parms = m_ScriptEngine.GetDetectParams(m_itemID, number); | 638 | XDetectParams parms = m_ScriptEngine.GetDetectParams(m_itemID, number); |
639 | if(parms == null) | ||
640 | return new LSL_Types.Vector3(0, 0, 0); | ||
639 | 641 | ||
640 | return parms.OffsetPos; | 642 | return parms.OffsetPos; |
641 | } | 643 | } |
@@ -660,8 +662,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
660 | public LSL_Types.LSLInteger llDetectedLinkNumber(int number) | 662 | public LSL_Types.LSLInteger llDetectedLinkNumber(int number) |
661 | { | 663 | { |
662 | m_host.AddScriptLPS(1); | 664 | m_host.AddScriptLPS(1); |
663 | NotImplemented("llDetectedLinkNumber"); | 665 | XDetectParams parms = m_ScriptEngine.GetDetectParams(m_itemID, number); |
664 | return 0; | 666 | if(parms == null) |
667 | return new LSL_Types.LSLInteger(0); | ||
668 | |||
669 | return new LSL_Types.LSLInteger(parms.LinkNum); | ||
665 | } | 670 | } |
666 | 671 | ||
667 | public void llDie() | 672 | public void llDie() |
@@ -1920,8 +1925,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1920 | msg.fromAgentSession = new Guid(friendTransactionID.ToString());// fromAgentSession.UUID; | 1925 | msg.fromAgentSession = new Guid(friendTransactionID.ToString());// fromAgentSession.UUID; |
1921 | msg.toAgentID = new Guid(user); // toAgentID.UUID; | 1926 | msg.toAgentID = new Guid(user); // toAgentID.UUID; |
1922 | msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here | 1927 | msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here |
1923 | Console.WriteLine("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message); | 1928 | // Console.WriteLine("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message); |
1924 | Console.WriteLine("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString()); | 1929 | // Console.WriteLine("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString()); |
1925 | msg.timestamp = (uint)Util.UnixTimeSinceEpoch();// timestamp; | 1930 | msg.timestamp = (uint)Util.UnixTimeSinceEpoch();// timestamp; |
1926 | //if (client != null) | 1931 | //if (client != null) |
1927 | //{ | 1932 | //{ |
@@ -2513,15 +2518,21 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
2513 | UserProfileData userProfile = | 2518 | UserProfileData userProfile = |
2514 | World.CommsManager.UserService.GetUserProfile(id); | 2519 | World.CommsManager.UserService.GetUserProfile(id); |
2515 | 2520 | ||
2521 | UserAgentData userAgent = | ||
2522 | World.CommsManager.UserService.GetAgentByUUID(id); | ||
2523 | |||
2524 | if(userProfile == null || userAgent == null) | ||
2525 | return LLUUID.Zero.ToString(); | ||
2526 | |||
2516 | string reply = String.Empty; | 2527 | string reply = String.Empty; |
2517 | 2528 | ||
2518 | switch (data) | 2529 | switch (data) |
2519 | { | 2530 | { |
2520 | case 1: // DATA_ONLINE (0|1) | 2531 | case 1: // DATA_ONLINE (0|1) |
2521 | // TODO: implement fetching of this information | 2532 | // TODO: implement fetching of this information |
2522 | // if (userProfile.CurrentAgent.AgentOnline) | 2533 | if (userProfile.CurrentAgent.AgentOnline) |
2523 | // reply = "1"; | 2534 | reply = "1"; |
2524 | // else | 2535 | else |
2525 | reply = "0"; | 2536 | reply = "0"; |
2526 | break; | 2537 | break; |
2527 | case 2: // DATA_NAME (First Last) | 2538 | case 2: // DATA_NAME (First Last) |
@@ -2672,8 +2683,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
2672 | 2683 | ||
2673 | case (int)BuiltIn_Commands_BaseClass.LINK_SET: | 2684 | case (int)BuiltIn_Commands_BaseClass.LINK_SET: |
2674 | 2685 | ||
2675 | Console.WriteLine("LINK_SET"); | ||
2676 | |||
2677 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) | 2686 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) |
2678 | { | 2687 | { |
2679 | 2688 | ||
@@ -6280,7 +6289,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
6280 | System.Text.ASCIIEncoding enc = | 6289 | System.Text.ASCIIEncoding enc = |
6281 | new System.Text.ASCIIEncoding(); | 6290 | new System.Text.ASCIIEncoding(); |
6282 | string data = enc.GetString(a.Data); | 6291 | string data = enc.GetString(a.Data); |
6283 | Console.WriteLine(data); | 6292 | //Console.WriteLine(data); |
6284 | NotecardCache.Cache(id, data); | 6293 | NotecardCache.Cache(id, data); |
6285 | m_ScriptEngine.m_ASYNCLSLCommandManager. | 6294 | m_ScriptEngine.m_ASYNCLSLCommandManager. |
6286 | m_Dataserver.DataserverReply(id.ToString(), | 6295 | m_Dataserver.DataserverReply(id.ToString(), |
@@ -6316,7 +6325,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
6316 | System.Text.ASCIIEncoding enc = | 6325 | System.Text.ASCIIEncoding enc = |
6317 | new System.Text.ASCIIEncoding(); | 6326 | new System.Text.ASCIIEncoding(); |
6318 | string data = enc.GetString(a.Data); | 6327 | string data = enc.GetString(a.Data); |
6319 | Console.WriteLine(data); | 6328 | //Console.WriteLine(data); |
6320 | NotecardCache.Cache(id, data); | 6329 | NotecardCache.Cache(id, data); |
6321 | m_ScriptEngine.m_ASYNCLSLCommandManager. | 6330 | m_ScriptEngine.m_ASYNCLSLCommandManager. |
6322 | m_Dataserver.DataserverReply(id.ToString(), | 6331 | m_Dataserver.DataserverReply(id.ToString(), |