diff options
author | Melanie Thielker | 2008-09-25 05:13:44 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-25 05:13:44 +0000 |
commit | f3c8963c86dbc969541ede80ae37eb59d26b7809 (patch) | |
tree | ff1e5cea74e9d5c2b73c476320a7bddf11d93766 /OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Listener.cs | |
parent | Mantis#2123. Thank you kindly, Idb for a patch that solves: (diff) | |
download | opensim-SC_OLD-f3c8963c86dbc969541ede80ae37eb59d26b7809.zip opensim-SC_OLD-f3c8963c86dbc969541ede80ae37eb59d26b7809.tar.gz opensim-SC_OLD-f3c8963c86dbc969541ede80ae37eb59d26b7809.tar.bz2 opensim-SC_OLD-f3c8963c86dbc969541ede80ae37eb59d26b7809.tar.xz |
Convergence is almost complete. This brings the diff between the API to < 10k
and makes it use a common set of types in both engine. Fixes the issues with
running both engines and HTTP requests / listens / timers etc..
Also fixes a couple of minor Scene issues and a CTB by nullref.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Listener.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Listener.cs | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Listener.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Listener.cs deleted file mode 100644 index 0bac22c..0000000 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Listener.cs +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using OpenSim.Region.Environment.Interfaces; | ||
29 | using OpenSim.Region.Environment.Modules.Scripting.WorldComm; | ||
30 | using OpenSim.Region.ScriptEngine.Shared; | ||
31 | |||
32 | namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugins | ||
33 | { | ||
34 | public class Listener | ||
35 | { | ||
36 | // private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
37 | |||
38 | public AsyncCommandManager m_CmdManager; | ||
39 | |||
40 | public Listener(AsyncCommandManager CmdManager) | ||
41 | { | ||
42 | m_CmdManager = CmdManager; | ||
43 | } | ||
44 | |||
45 | public void CheckListeners() | ||
46 | { | ||
47 | if (m_CmdManager.m_ScriptEngine.World == null) | ||
48 | return; | ||
49 | IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | ||
50 | |||
51 | if (comms != null) | ||
52 | { | ||
53 | while (comms.HasMessages()) | ||
54 | { | ||
55 | ListenerInfo lInfo = comms.GetNextMessage(); | ||
56 | if (m_CmdManager.m_ScriptEngine.m_ScriptManager.GetScript( | ||
57 | lInfo.GetLocalID(), lInfo.GetItemID()) != null) | ||
58 | { | ||
59 | //Deliver data to prim's listen handler | ||
60 | object[] resobj = new object[] | ||
61 | { | ||
62 | //lInfo.GetChannel(), lInfo.GetName(), lInfo.GetID().ToString(), lInfo.GetMessage() | ||
63 | 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()) | ||
64 | }; | ||
65 | |||
66 | m_CmdManager.m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | ||
67 | lInfo.GetLocalID(), lInfo.GetItemID(), "listen", EventQueueManager.llDetectNull, resobj | ||
68 | ); | ||
69 | } | ||
70 | // else | ||
71 | // m_log.Info("[ScriptEngineBase.AsyncCommandPlugins: received a listen event for a (no longer) existing script ("+lInfo.GetLocalID().AsString()+")"); | ||
72 | } | ||
73 | } | ||
74 | } | ||
75 | } | ||
76 | } | ||