Add some conditionals to references to the WorldComm module, so that the

module can be disabled without crashing the sim
mysql-performance
Melanie 2009-11-28 09:23:26 +00:00
parent e7333515d9
commit 9fd9211a38
2 changed files with 18 additions and 8 deletions

View File

@ -236,7 +236,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
iHttpReq.StopHttpRequest(localID, itemID);
IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>();
comms.DeleteListener(itemID);
if (comms != null)
comms.DeleteListener(itemID);
IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>();
xmlrpc.DeleteChannels(itemID);

View File

@ -734,7 +734,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ChatTypeEnum.Whisper, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text);
if (wComm != null)
wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text);
}
public void llSay(int channelID, string text)
@ -754,7 +755,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ChatTypeEnum.Say, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text);
if (wComm != null)
wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text);
}
}
@ -769,7 +771,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ChatTypeEnum.Shout, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, text);
if (wComm != null)
wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, text);
}
public void llRegionSay(int channelID, string text)
@ -786,7 +789,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text);
if (wComm != null)
wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text);
}
public LSL_Integer llListen(int channelID, string name, string ID, string msg)
@ -795,21 +799,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID keyID;
UUID.TryParse(ID, out keyID);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg);
if (wComm != null)
return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg);
else
return -1;
}
public void llListenControl(int number, int active)
{
m_host.AddScriptLPS(1);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
wComm.ListenControl(m_itemID, number, active);
if (wComm != null)
wComm.ListenControl(m_itemID, number, active);
}
public void llListenRemove(int number)
{
m_host.AddScriptLPS(1);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
wComm.ListenRemove(m_itemID, number);
if (wComm != null)
wComm.ListenRemove(m_itemID, number);
}
public void llSensor(string name, string id, int type, double range, double arc)