diff options
author | lbsa71 | 2007-10-30 09:05:31 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-30 09:05:31 +0000 |
commit | 67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch) | |
tree | 20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs | |
parent | * Deleted .user file (diff) | |
download | opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2 opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz |
* Optimized usings
* Shortened type references
* Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs | 173 |
1 files changed, 131 insertions, 42 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs index 8f0a591..85ac597 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs | |||
@@ -27,11 +27,8 @@ | |||
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | ||
31 | using System.Text; | ||
32 | using libsecondlife; | 30 | using libsecondlife; |
33 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
34 | using OpenSim.Region.Environment.Scenes.Scripting; | ||
35 | 32 | ||
36 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
37 | { | 34 | { |
@@ -39,7 +36,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
39 | /// Prepares events so they can be directly executed upon a script by EventQueueManager, then queues it. | 36 | /// Prepares events so they can be directly executed upon a script by EventQueueManager, then queues it. |
40 | /// </summary> | 37 | /// </summary> |
41 | [Serializable] | 38 | [Serializable] |
42 | class EventManager | 39 | internal class EventManager |
43 | { | 40 | { |
44 | private ScriptEngine myScriptEngine; | 41 | private ScriptEngine myScriptEngine; |
45 | //public IScriptHost TEMP_OBJECT_ID; | 42 | //public IScriptHost TEMP_OBJECT_ID; |
@@ -55,7 +52,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
55 | myScriptEngine.World.EventManager.OnObjectGrab += touch_start; | 52 | myScriptEngine.World.EventManager.OnObjectGrab += touch_start; |
56 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; | 53 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; |
57 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; | 54 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; |
58 | |||
59 | } | 55 | } |
60 | 56 | ||
61 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) | 57 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) |
@@ -63,17 +59,20 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
63 | // Add to queue for all scripts in ObjectID object | 59 | // Add to queue for all scripts in ObjectID object |
64 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start"); | 60 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start"); |
65 | //Console.WriteLine("touch_start localID: " + localID); | 61 | //Console.WriteLine("touch_start localID: " + localID); |
66 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] { (int)1 }); | 62 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1}); |
67 | } | 63 | } |
64 | |||
68 | public void OnRezScript(uint localID, LLUUID itemID, string script) | 65 | public void OnRezScript(uint localID, LLUUID itemID, string script) |
69 | { | 66 | { |
70 | //myScriptEngine.myScriptManager.StartScript( | 67 | //myScriptEngine.myScriptManager.StartScript( |
71 | // Path.Combine("ScriptEngines", "Default.lsl"), | 68 | // Path.Combine("ScriptEngines", "Default.lsl"), |
72 | // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() | 69 | // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() |
73 | //); | 70 | //); |
74 | Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + script.Length); | 71 | Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + |
72 | script.Length); | ||
75 | myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script); | 73 | myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script); |
76 | } | 74 | } |
75 | |||
77 | public void OnRemoveScript(uint localID, LLUUID itemID) | 76 | public void OnRemoveScript(uint localID, LLUUID itemID) |
78 | { | 77 | { |
79 | //myScriptEngine.myScriptManager.StartScript( | 78 | //myScriptEngine.myScriptManager.StartScript( |
@@ -84,48 +83,138 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
84 | myScriptEngine.m_ScriptManager.StopScript( | 83 | myScriptEngine.m_ScriptManager.StopScript( |
85 | localID, | 84 | localID, |
86 | itemID | 85 | itemID |
87 | ); | 86 | ); |
88 | |||
89 | } | 87 | } |
90 | 88 | ||
91 | // TODO: Replace placeholders below | 89 | // TODO: Replace placeholders below |
92 | // These needs to be hooked up to OpenSim during init of this class | 90 | // These needs to be hooked up to OpenSim during init of this class |
93 | // then queued in EventQueueManager. | 91 | // then queued in EventQueueManager. |
94 | // When queued in EventQueueManager they need to be LSL compatible (name and params) | 92 | // When queued in EventQueueManager they need to be LSL compatible (name and params) |
95 | 93 | ||
96 | //public void state_entry() { } // | 94 | //public void state_entry() { } // |
97 | public void state_exit() { } | 95 | public void state_exit() |
96 | { | ||
97 | } | ||
98 | |||
98 | //public void touch_start() { } | 99 | //public void touch_start() { } |
99 | public void touch() { } | 100 | public void touch() |
100 | public void touch_end() { } | 101 | { |
101 | public void collision_start() { } | 102 | } |
102 | public void collision() { } | 103 | |
103 | public void collision_end() { } | 104 | public void touch_end() |
104 | public void land_collision_start() { } | 105 | { |
105 | public void land_collision() { } | 106 | } |
106 | public void land_collision_end() { } | 107 | |
107 | public void timer() { } | 108 | public void collision_start() |
108 | public void listen() { } | 109 | { |
109 | public void on_rez() { } | 110 | } |
110 | public void sensor() { } | 111 | |
111 | public void no_sensor() { } | 112 | public void collision() |
112 | public void control() { } | 113 | { |
113 | public void money() { } | 114 | } |
114 | public void email() { } | 115 | |
115 | public void at_target() { } | 116 | public void collision_end() |
116 | public void not_at_target() { } | 117 | { |
117 | public void at_rot_target() { } | 118 | } |
118 | public void not_at_rot_target() { } | 119 | |
119 | public void run_time_permissions() { } | 120 | public void land_collision_start() |
120 | public void changed() { } | 121 | { |
121 | public void attach() { } | 122 | } |
122 | public void dataserver() { } | 123 | |
123 | public void link_message() { } | 124 | public void land_collision() |
124 | public void moving_start() { } | 125 | { |
125 | public void moving_end() { } | 126 | } |
126 | public void object_rez() { } | 127 | |
127 | public void remote_data() { } | 128 | public void land_collision_end() |
128 | public void http_response() { } | 129 | { |
130 | } | ||
131 | |||
132 | public void timer() | ||
133 | { | ||
134 | } | ||
135 | |||
136 | public void listen() | ||
137 | { | ||
138 | } | ||
139 | |||
140 | public void on_rez() | ||
141 | { | ||
142 | } | ||
143 | |||
144 | public void sensor() | ||
145 | { | ||
146 | } | ||
147 | |||
148 | public void no_sensor() | ||
149 | { | ||
150 | } | ||
151 | |||
152 | public void control() | ||
153 | { | ||
154 | } | ||
155 | |||
156 | public void money() | ||
157 | { | ||
158 | } | ||
159 | |||
160 | public void email() | ||
161 | { | ||
162 | } | ||
163 | |||
164 | public void at_target() | ||
165 | { | ||
166 | } | ||
167 | |||
168 | public void not_at_target() | ||
169 | { | ||
170 | } | ||
171 | |||
172 | public void at_rot_target() | ||
173 | { | ||
174 | } | ||
175 | |||
176 | public void not_at_rot_target() | ||
177 | { | ||
178 | } | ||
179 | |||
180 | public void run_time_permissions() | ||
181 | { | ||
182 | } | ||
183 | |||
184 | public void changed() | ||
185 | { | ||
186 | } | ||
187 | |||
188 | public void attach() | ||
189 | { | ||
190 | } | ||
191 | |||
192 | public void dataserver() | ||
193 | { | ||
194 | } | ||
195 | |||
196 | public void link_message() | ||
197 | { | ||
198 | } | ||
199 | |||
200 | public void moving_start() | ||
201 | { | ||
202 | } | ||
203 | |||
204 | public void moving_end() | ||
205 | { | ||
206 | } | ||
207 | |||
208 | public void object_rez() | ||
209 | { | ||
210 | } | ||
211 | |||
212 | public void remote_data() | ||
213 | { | ||
214 | } | ||
129 | 215 | ||
216 | public void http_response() | ||
217 | { | ||
218 | } | ||
130 | } | 219 | } |
131 | } | 220 | } \ No newline at end of file |