diff options
author | Melanie | 2009-11-28 09:23:26 +0000 |
---|---|---|
committer | Melanie | 2009-11-28 09:23:26 +0000 |
commit | 9fd9211a3868b78c0fe7a8672d563f5a346dc955 (patch) | |
tree | a963bf0251df5db959ce7d9c75d5acc3de121cf3 /OpenSim/Region/ScriptEngine | |
parent | Merge branch 'master' of ssh://MyConnection/var/git/opensim (diff) | |
download | opensim-SC-9fd9211a3868b78c0fe7a8672d563f5a346dc955.zip opensim-SC-9fd9211a3868b78c0fe7a8672d563f5a346dc955.tar.gz opensim-SC-9fd9211a3868b78c0fe7a8672d563f5a346dc955.tar.bz2 opensim-SC-9fd9211a3868b78c0fe7a8672d563f5a346dc955.tar.xz |
Add some conditionals to references to the WorldComm module, so that the
module can be disabled without crashing the sim
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 23 |
2 files changed, 18 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index 9d97cb2..ee32755 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |||
@@ -236,7 +236,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
236 | iHttpReq.StopHttpRequest(localID, itemID); | 236 | iHttpReq.StopHttpRequest(localID, itemID); |
237 | 237 | ||
238 | IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>(); | 238 | IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>(); |
239 | comms.DeleteListener(itemID); | 239 | if (comms != null) |
240 | comms.DeleteListener(itemID); | ||
240 | 241 | ||
241 | IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>(); | 242 | IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>(); |
242 | xmlrpc.DeleteChannels(itemID); | 243 | xmlrpc.DeleteChannels(itemID); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f5cda2c..d235bac 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -734,7 +734,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
734 | ChatTypeEnum.Whisper, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); | 734 | ChatTypeEnum.Whisper, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); |
735 | 735 | ||
736 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 736 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
737 | wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text); | 737 | if (wComm != null) |
738 | wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text); | ||
738 | } | 739 | } |
739 | 740 | ||
740 | public void llSay(int channelID, string text) | 741 | public void llSay(int channelID, string text) |
@@ -754,7 +755,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
754 | ChatTypeEnum.Say, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); | 755 | ChatTypeEnum.Say, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); |
755 | 756 | ||
756 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 757 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
757 | wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text); | 758 | if (wComm != null) |
759 | wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text); | ||
758 | } | 760 | } |
759 | } | 761 | } |
760 | 762 | ||
@@ -769,7 +771,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
769 | ChatTypeEnum.Shout, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true); | 771 | ChatTypeEnum.Shout, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true); |
770 | 772 | ||
771 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 773 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
772 | wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, text); | 774 | if (wComm != null) |
775 | wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, text); | ||
773 | } | 776 | } |
774 | 777 | ||
775 | public void llRegionSay(int channelID, string text) | 778 | public void llRegionSay(int channelID, string text) |
@@ -786,7 +789,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
786 | m_host.AddScriptLPS(1); | 789 | m_host.AddScriptLPS(1); |
787 | 790 | ||
788 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 791 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
789 | wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text); | 792 | if (wComm != null) |
793 | wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text); | ||
790 | } | 794 | } |
791 | 795 | ||
792 | public LSL_Integer llListen(int channelID, string name, string ID, string msg) | 796 | public LSL_Integer llListen(int channelID, string name, string ID, string msg) |
@@ -795,21 +799,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
795 | UUID keyID; | 799 | UUID keyID; |
796 | UUID.TryParse(ID, out keyID); | 800 | UUID.TryParse(ID, out keyID); |
797 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 801 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
798 | return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg); | 802 | if (wComm != null) |
803 | return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg); | ||
804 | else | ||
805 | return -1; | ||
799 | } | 806 | } |
800 | 807 | ||
801 | public void llListenControl(int number, int active) | 808 | public void llListenControl(int number, int active) |
802 | { | 809 | { |
803 | m_host.AddScriptLPS(1); | 810 | m_host.AddScriptLPS(1); |
804 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 811 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
805 | wComm.ListenControl(m_itemID, number, active); | 812 | if (wComm != null) |
813 | wComm.ListenControl(m_itemID, number, active); | ||
806 | } | 814 | } |
807 | 815 | ||
808 | public void llListenRemove(int number) | 816 | public void llListenRemove(int number) |
809 | { | 817 | { |
810 | m_host.AddScriptLPS(1); | 818 | m_host.AddScriptLPS(1); |
811 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 819 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
812 | wComm.ListenRemove(m_itemID, number); | 820 | if (wComm != null) |
821 | wComm.ListenRemove(m_itemID, number); | ||
813 | } | 822 | } |
814 | 823 | ||
815 | public void llSensor(string name, string id, int type, double range, double arc) | 824 | public void llSensor(string name, string id, int type, double range, double arc) |