mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
* Applying patch #1121 - Fixes for llListen() (Thanks Middlelink!)
This commit is contained in:
@@ -465,7 +465,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
|
||||
|
||||
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
|
||||
wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Whisper, channelID, m_host.Name, text);
|
||||
wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text);
|
||||
}
|
||||
|
||||
public void llSay(int channelID, string text)
|
||||
@@ -475,7 +475,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
|
||||
|
||||
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
|
||||
wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, channelID, m_host.Name, text);
|
||||
wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text);
|
||||
}
|
||||
|
||||
public void llShout(int channelID, string text)
|
||||
@@ -485,7 +485,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
|
||||
|
||||
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
|
||||
wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Shout, channelID, m_host.Name, text);
|
||||
wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, text);
|
||||
}
|
||||
|
||||
public void llRegionSay(int channelID, string text)
|
||||
@@ -499,32 +499,30 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
|
||||
wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Broadcast, channelID, m_host.Name, text);
|
||||
wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text);
|
||||
}
|
||||
|
||||
public int llListen(int channelID, string name, string ID, string msg)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
if (ID == String.Empty)
|
||||
{
|
||||
ID = LLUUID.Zero.ToString();
|
||||
}
|
||||
LLUUID keyID;
|
||||
LLUUID.TryParse(ID, out keyID);
|
||||
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
|
||||
return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, ID, msg);
|
||||
return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg);
|
||||
}
|
||||
|
||||
public void llListenControl(int number, int active)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
|
||||
wComm.ListenControl(number, active);
|
||||
wComm.ListenControl(m_itemID, number, active);
|
||||
}
|
||||
|
||||
public void llListenRemove(int number)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
|
||||
wComm.ListenRemove(number);
|
||||
wComm.ListenRemove(m_itemID, number);
|
||||
}
|
||||
|
||||
public void llSensor(string name, string id, int type, double range, double arc)
|
||||
@@ -5409,9 +5407,9 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
// llGetOwner ==> m_host.ObjectOwner.ToString()
|
||||
llInstantMessage(m_host.ObjectOwner.ToString(),msg);
|
||||
|
||||
//World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Say, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
|
||||
//World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
|
||||
//IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
|
||||
//wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, 0, m_host.Name, msg);
|
||||
//wComm.DeliverMessage(ChatTypeEnum.Owner, 0, m_host.Name, m_host.UUID, msg);
|
||||
}
|
||||
|
||||
public void llRequestSimulatorData(string simulator, int data)
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
|
||||
{
|
||||
public class Listener
|
||||
{
|
||||
// private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public AsyncCommandManager m_CmdManager;
|
||||
|
||||
public Listener(AsyncCommandManager CmdManager)
|
||||
@@ -49,22 +51,23 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
|
||||
{
|
||||
while (comms.HasMessages())
|
||||
{
|
||||
ListenerInfo lInfo = comms.GetNextMessage();
|
||||
if (m_CmdManager.m_ScriptEngine.m_ScriptManager.GetScript(
|
||||
comms.PeekNextMessageLocalID(), comms.PeekNextMessageItemID()) != null)
|
||||
lInfo.GetLocalID(), lInfo.GetItemID()) != null)
|
||||
{
|
||||
ListenerInfo lInfo = comms.GetNextMessage();
|
||||
|
||||
//Deliver data to prim's listen handler
|
||||
object[] resobj = new object[]
|
||||
{
|
||||
//lInfo.GetChannel(), lInfo.GetName(), lInfo.GetID().ToString(), lInfo.GetMessage()
|
||||
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())
|
||||
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())
|
||||
};
|
||||
|
||||
m_CmdManager.m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
|
||||
lInfo.GetLocalID(), lInfo.GetItemID(), "listen", EventQueueManager.llDetectNull, resobj
|
||||
);
|
||||
}
|
||||
// else
|
||||
// m_log.Info("[ScriptEngineBase.AsyncCommandPlugins: received a listen event for a (no longer) existing script ("+lInfo.GetLocalID().AsString()+")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user