aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs')
-rw-r--r--OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs222
1 files changed, 0 insertions, 222 deletions
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs
deleted file mode 100644
index 0d2d7cf..0000000
--- a/OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs
+++ /dev/null
@@ -1,222 +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/* Original code: Tedd Hansen */
29using System;
30using libsecondlife;
31using OpenSim.Framework;
32
33namespace OpenSim.Grid.ScriptEngine.DotNetEngine
34{
35 /// <summary>
36 /// Prepares events so they can be directly executed upon a script by EventQueueManager, then queues it.
37 /// </summary>
38 [Serializable]
39 internal class EventManager
40 {
41 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
42
43 private ScriptEngine myScriptEngine;
44 //public IScriptHost TEMP_OBJECT_ID;
45 public EventManager(ScriptEngine _ScriptEngine)
46 {
47 myScriptEngine = _ScriptEngine;
48 // TODO: HOOK EVENTS UP TO SERVER!
49 //myScriptEngine.m_log.Info("[ScriptEngine]: EventManager Start");
50 // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager
51
52 // Hook up a test event to our test form
53 myScriptEngine.m_log.Info("[ScriptEngine]: Hooking up to server events");
54 myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
55 myScriptEngine.World.EventManager.OnRezScript += OnRezScript;
56 myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript;
57 }
58
59 public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
60 {
61 // Add to queue for all scripts in ObjectID object
62 //myScriptEngine.m_log.Info("[ScriptEngine]: EventManager Event: touch_start");
63 //Console.WriteLine("touch_start localID: " + localID);
64 myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1});
65 }
66
67 public void OnRezScript(uint localID, LLUUID itemID, string script)
68 {
69 //myScriptEngine.myScriptManager.StartScript(
70 // Path.Combine("ScriptEngines", "Default.lsl"),
71 // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost()
72 //);
73 Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " +
74 script.Length);
75 myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script);
76 }
77
78 public void OnRemoveScript(uint localID, LLUUID itemID)
79 {
80 //myScriptEngine.myScriptManager.StartScript(
81 // Path.Combine("ScriptEngines", "Default.lsl"),
82 // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost()
83 //);
84 Console.WriteLine("OnRemoveScript localID: " + localID + " LLUID: " + itemID.ToString());
85 myScriptEngine.m_ScriptManager.StopScript(
86 localID,
87 itemID
88 );
89 }
90
91 // TODO: Replace placeholders below
92 // These needs to be hooked up to OpenSim during init of this class
93 // then queued in EventQueueManager.
94 // When queued in EventQueueManager they need to be LSL compatible (name and params)
95
96 //public void state_entry() { }
97 public void state_exit()
98 {
99 }
100
101 //public void touch_start() { }
102 public void touch()
103 {
104 }
105
106 public void touch_end()
107 {
108 }
109
110 public void collision_start()
111 {
112 }
113
114 public void collision()
115 {
116 }
117
118 public void collision_end()
119 {
120 }
121
122 public void land_collision_start()
123 {
124 }
125
126 public void land_collision()
127 {
128 }
129
130 public void land_collision_end()
131 {
132 }
133
134 public void timer()
135 {
136 }
137
138 public void listen()
139 {
140 }
141
142 public void on_rez()
143 {
144 }
145
146 public void sensor()
147 {
148 }
149
150 public void no_sensor()
151 {
152 }
153
154 public void control()
155 {
156 }
157
158 public void money()
159 {
160 }
161
162 public void email()
163 {
164 }
165
166 public void at_target()
167 {
168 }
169
170 public void not_at_target()
171 {
172 }
173
174 public void at_rot_target()
175 {
176 }
177
178 public void not_at_rot_target()
179 {
180 }
181
182 public void run_time_permissions()
183 {
184 }
185
186 public void changed()
187 {
188 }
189
190 public void attach()
191 {
192 }
193
194 public void dataserver()
195 {
196 }
197
198 public void link_message()
199 {
200 }
201
202 public void moving_start()
203 {
204 }
205
206 public void moving_end()
207 {
208 }
209
210 public void object_rez()
211 {
212 }
213
214 public void remote_data()
215 {
216 }
217
218 public void http_response()
219 {
220 }
221 }
222}