aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs24
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Listener.cs11
2 files changed, 18 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 5c705b3..805a575 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -465,7 +465,7 @@ namespace OpenSim.Region.ScriptEngine.Common
465 ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 465 ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
466 466
467 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 467 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
468 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Whisper, channelID, m_host.Name, text); 468 wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text);
469 } 469 }
470 470
471 public void llSay(int channelID, string text) 471 public void llSay(int channelID, string text)
@@ -475,7 +475,7 @@ namespace OpenSim.Region.ScriptEngine.Common
475 ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 475 ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
476 476
477 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 477 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
478 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, channelID, m_host.Name, text); 478 wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text);
479 } 479 }
480 480
481 public void llShout(int channelID, string text) 481 public void llShout(int channelID, string text)
@@ -485,7 +485,7 @@ namespace OpenSim.Region.ScriptEngine.Common
485 ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 485 ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
486 486
487 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 487 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
488 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Shout, channelID, m_host.Name, text); 488 wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, text);
489 } 489 }
490 490
491 public void llRegionSay(int channelID, string text) 491 public void llRegionSay(int channelID, string text)
@@ -499,32 +499,30 @@ namespace OpenSim.Region.ScriptEngine.Common
499 m_host.AddScriptLPS(1); 499 m_host.AddScriptLPS(1);
500 500
501 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 501 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
502 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Broadcast, channelID, m_host.Name, text); 502 wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text);
503 } 503 }
504 504
505 public int llListen(int channelID, string name, string ID, string msg) 505 public int llListen(int channelID, string name, string ID, string msg)
506 { 506 {
507 m_host.AddScriptLPS(1); 507 m_host.AddScriptLPS(1);
508 if (ID == String.Empty) 508 LLUUID keyID;
509 { 509 LLUUID.TryParse(ID, out keyID);
510 ID = LLUUID.Zero.ToString();
511 }
512 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 510 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
513 return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, ID, msg); 511 return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg);
514 } 512 }
515 513
516 public void llListenControl(int number, int active) 514 public void llListenControl(int number, int active)
517 { 515 {
518 m_host.AddScriptLPS(1); 516 m_host.AddScriptLPS(1);
519 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 517 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
520 wComm.ListenControl(number, active); 518 wComm.ListenControl(m_itemID, number, active);
521 } 519 }
522 520
523 public void llListenRemove(int number) 521 public void llListenRemove(int number)
524 { 522 {
525 m_host.AddScriptLPS(1); 523 m_host.AddScriptLPS(1);
526 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 524 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
527 wComm.ListenRemove(number); 525 wComm.ListenRemove(m_itemID, number);
528 } 526 }
529 527
530 public void llSensor(string name, string id, int type, double range, double arc) 528 public void llSensor(string name, string id, int type, double range, double arc)
@@ -5409,9 +5407,9 @@ namespace OpenSim.Region.ScriptEngine.Common
5409 // llGetOwner ==> m_host.ObjectOwner.ToString() 5407 // llGetOwner ==> m_host.ObjectOwner.ToString()
5410 llInstantMessage(m_host.ObjectOwner.ToString(),msg); 5408 llInstantMessage(m_host.ObjectOwner.ToString(),msg);
5411 5409
5412 //World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Say, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 5410 //World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
5413 //IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 5411 //IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
5414 //wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, 0, m_host.Name, msg); 5412 //wComm.DeliverMessage(ChatTypeEnum.Owner, 0, m_host.Name, m_host.UUID, msg);
5415 } 5413 }
5416 5414
5417 public void llRequestSimulatorData(string simulator, int data) 5415 public void llRequestSimulatorData(string simulator, int data)
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Listener.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Listener.cs
index 55dbabf..6a1235b 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Listener.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Listener.cs
@@ -32,6 +32,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
32{ 32{
33 public class Listener 33 public class Listener
34 { 34 {
35 // private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
36
35 public AsyncCommandManager m_CmdManager; 37 public AsyncCommandManager m_CmdManager;
36 38
37 public Listener(AsyncCommandManager CmdManager) 39 public Listener(AsyncCommandManager CmdManager)
@@ -49,22 +51,23 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
49 { 51 {
50 while (comms.HasMessages()) 52 while (comms.HasMessages())
51 { 53 {
54 ListenerInfo lInfo = comms.GetNextMessage();
52 if (m_CmdManager.m_ScriptEngine.m_ScriptManager.GetScript( 55 if (m_CmdManager.m_ScriptEngine.m_ScriptManager.GetScript(
53 comms.PeekNextMessageLocalID(), comms.PeekNextMessageItemID()) != null) 56 lInfo.GetLocalID(), lInfo.GetItemID()) != null)
54 { 57 {
55 ListenerInfo lInfo = comms.GetNextMessage();
56
57 //Deliver data to prim's listen handler 58 //Deliver data to prim's listen handler
58 object[] resobj = new object[] 59 object[] resobj = new object[]
59 { 60 {
60 //lInfo.GetChannel(), lInfo.GetName(), lInfo.GetID().ToString(), lInfo.GetMessage() 61 //lInfo.GetChannel(), lInfo.GetName(), lInfo.GetID().ToString(), lInfo.GetMessage()
61 new LSL_Types.LSLInteger(lInfo.GetChannel()), new LSL_Types.LSLString(lInfo.GetName()), new LSL_Types.LSLString(lInfo.GetSourceItemID().ToString()), new LSL_Types.LSLString(lInfo.GetMessage()) 62 new LSL_Types.LSLInteger(lInfo.GetChannel()), new LSL_Types.LSLString(lInfo.GetName()), new LSL_Types.LSLString(lInfo.GetID().ToString()), new LSL_Types.LSLString(lInfo.GetMessage())
62 }; 63 };
63 64
64 m_CmdManager.m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( 65 m_CmdManager.m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
65 lInfo.GetLocalID(), lInfo.GetItemID(), "listen", EventQueueManager.llDetectNull, resobj 66 lInfo.GetLocalID(), lInfo.GetItemID(), "listen", EventQueueManager.llDetectNull, resobj
66 ); 67 );
67 } 68 }
69 // else
70 // m_log.Info("[ScriptEngineBase.AsyncCommandPlugins: received a listen event for a (no longer) existing script ("+lInfo.GetLocalID().AsString()+")");
68 } 71 }
69 } 72 }
70 } 73 }