diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs | 263 |
1 files changed, 0 insertions, 263 deletions
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs deleted file mode 100644 index afb7311..0000000 --- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs +++ /dev/null | |||
@@ -1,263 +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 */ | ||
29 | |||
30 | using System; | ||
31 | using OpenMetaverse; | ||
32 | using OpenSim.Framework; | ||
33 | using OpenSim.Region.ScriptEngine.Common; | ||
34 | using OpenSim.Region.ScriptEngine.Common.TRPC; | ||
35 | |||
36 | namespace OpenSim.Region.ScriptEngine.RemoteServer | ||
37 | { | ||
38 | /// <summary> | ||
39 | /// Handles events from OpenSim. Uses RemoteServer to send commands. | ||
40 | /// </summary> | ||
41 | [Serializable] | ||
42 | internal class EventManager | ||
43 | { | ||
44 | // TODO: unused: System.Collections.Generic.Dictionary<uint, ScriptServerInterfaces.ServerRemotingObject> remoteScript = new System.Collections.Generic.Dictionary<uint, ScriptServerInterfaces.ServerRemotingObject>(); | ||
45 | TCPClient m_TCPClient; | ||
46 | TRPC_Remote RPC; | ||
47 | int myScriptServerID; | ||
48 | |||
49 | string remoteHost = "127.0.0.1"; | ||
50 | int remotePort = 8010; | ||
51 | |||
52 | private ScriptEngine myScriptEngine; | ||
53 | public EventManager(ScriptEngine _ScriptEngine) | ||
54 | { | ||
55 | myScriptEngine = _ScriptEngine; | ||
56 | |||
57 | m_TCPClient = new TCPClient(); | ||
58 | RPC = new TRPC_Remote(m_TCPClient); | ||
59 | RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand); | ||
60 | myScriptServerID = m_TCPClient.ConnectAndReturnID(remoteHost, remotePort); | ||
61 | |||
62 | myScriptEngine.Log.Info("[RemoteEngine]: Hooking up to server events"); | ||
63 | //myScriptEngine.World.EventManager.OnObjectGrab += touch_start; | ||
64 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; | ||
65 | //myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; | ||
66 | } | ||
67 | |||
68 | void RPC_ReceiveCommand(int ID, string Command, params object[] p) | ||
69 | { | ||
70 | myScriptEngine.Log.Info("[REMOTESERVER]: Received command: '" + Command + "'"); | ||
71 | if (p != null) | ||
72 | { | ||
73 | for (int i = 0; i < p.Length; i++) | ||
74 | { | ||
75 | myScriptEngine.Log.Info("[REMOTESERVER]: Param " + i + ": " + p[i].ToString()); | ||
76 | } | ||
77 | } | ||
78 | } | ||
79 | |||
80 | public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez) | ||
81 | { | ||
82 | // WE ARE CREATING A NEW SCRIPT ... CREATE SCRIPT, GET A REMOTEID THAT WE MAP FROM LOCALID | ||
83 | myScriptEngine.Log.Info("[RemoteEngine]: Creating new script (with connection)"); | ||
84 | |||
85 | // Temp for now: We have one connection only - this is hardcoded in myScriptServerID | ||
86 | RPC.SendCommand(myScriptServerID, "OnRezScript", localID, itemID.ToString(), script); | ||
87 | |||
88 | //ScriptServerInterfaces.ServerRemotingObject obj = myScriptEngine.m_RemoteServer.Connect("localhost", 1234); | ||
89 | //remoteScript.Add(localID, obj); | ||
90 | //remoteScript[localID].Events().OnRezScript(localID, itemID, script); | ||
91 | } | ||
92 | |||
93 | public void touch_start(uint localID, Vector3 offsetPos, IClientAPI remoteClient) | ||
94 | { | ||
95 | //remoteScript[localID].Events.touch_start(localID, offsetPos, remoteClient); | ||
96 | RPC.SendCommand(myScriptServerID, "touch_start", offsetPos, "How to transfer IClientAPI?"); | ||
97 | } | ||
98 | |||
99 | |||
100 | // PLACEHOLDERS -- CODE WILL CHANGE! | ||
101 | |||
102 | |||
103 | //public void OnRemoveScript(uint localID, UUID itemID) | ||
104 | //{ | ||
105 | // remoteScript[localID].Events.OnRemoveScript(localID, itemID); | ||
106 | //} | ||
107 | |||
108 | //public void state_exit(uint localID, UUID itemID) | ||
109 | //{ | ||
110 | // remoteScript[localID].Events.state_exit(localID, itemID); | ||
111 | //} | ||
112 | |||
113 | //public void touch(uint localID, UUID itemID) | ||
114 | //{ | ||
115 | // remoteScript[localID].Events.touch(localID, itemID); | ||
116 | //} | ||
117 | |||
118 | //public void touch_end(uint localID, UUID itemID) | ||
119 | //{ | ||
120 | // remoteScript[localID].Events.touch_end(localID, itemID); | ||
121 | //} | ||
122 | |||
123 | //public void collision_start(uint localID, UUID itemID) | ||
124 | //{ | ||
125 | // remoteScript[localID].Events.collision_start(localID, itemID); | ||
126 | //} | ||
127 | |||
128 | //public void collision(uint localID, UUID itemID) | ||
129 | //{ | ||
130 | // remoteScript[localID].Events.collision(localID, itemID); | ||
131 | //} | ||
132 | |||
133 | //public void collision_end(uint localID, UUID itemID) | ||
134 | //{ | ||
135 | // remoteScript[localID].Events.collision_end(localID, itemID); | ||
136 | //} | ||
137 | |||
138 | //public void land_collision_start(uint localID, UUID itemID) | ||
139 | //{ | ||
140 | // remoteScript[localID].Events.land_collision_start(localID, itemID); | ||
141 | //} | ||
142 | |||
143 | //public void land_collision(uint localID, UUID itemID) | ||
144 | //{ | ||
145 | // remoteScript[localID].Events.land_collision(localID, itemID); | ||
146 | //} | ||
147 | |||
148 | //public void land_collision_end(uint localID, UUID itemID) | ||
149 | //{ | ||
150 | // remoteScript[localID].Events.land_collision_end(localID, itemID); | ||
151 | //} | ||
152 | |||
153 | //public void timer(uint localID, UUID itemID) | ||
154 | //{ | ||
155 | // remoteScript[localID].Events.timer(localID, itemID); | ||
156 | //} | ||
157 | |||
158 | //public void listen(uint localID, UUID itemID) | ||
159 | //{ | ||
160 | // remoteScript[localID].Events.listen(localID, itemID); | ||
161 | //} | ||
162 | |||
163 | //public void on_rez(uint localID, UUID itemID) | ||
164 | //{ | ||
165 | // remoteScript[localID].Events.on_rez(localID, itemID); | ||
166 | //} | ||
167 | |||
168 | //public void sensor(uint localID, UUID itemID) | ||
169 | //{ | ||
170 | // remoteScript[localID].Events.sensor(localID, itemID); | ||
171 | //} | ||
172 | |||
173 | //public void no_sensor(uint localID, UUID itemID) | ||
174 | //{ | ||
175 | // remoteScript[localID].Events.no_sensor(localID, itemID); | ||
176 | //} | ||
177 | |||
178 | //public void control(uint localID, UUID itemID) | ||
179 | //{ | ||
180 | // remoteScript[localID].Events.control(localID, itemID); | ||
181 | //} | ||
182 | |||
183 | //public void money(uint localID, UUID itemID) | ||
184 | //{ | ||
185 | // remoteScript[localID].Events.money(localID, itemID); | ||
186 | //} | ||
187 | |||
188 | //public void email(uint localID, UUID itemID) | ||
189 | //{ | ||
190 | // remoteScript[localID].Events.email(localID, itemID); | ||
191 | //} | ||
192 | |||
193 | //public void at_target(uint localID, UUID itemID) | ||
194 | //{ | ||
195 | // remoteScript[localID].Events.at_target(localID, itemID); | ||
196 | //} | ||
197 | |||
198 | //public void not_at_target(uint localID, UUID itemID) | ||
199 | //{ | ||
200 | // remoteScript[localID].Events.not_at_target(localID, itemID); | ||
201 | //} | ||
202 | |||
203 | //public void at_rot_target(uint localID, UUID itemID) | ||
204 | //{ | ||
205 | // remoteScript[localID].Events.at_rot_target(localID, itemID); | ||
206 | //} | ||
207 | |||
208 | //public void not_at_rot_target(uint localID, UUID itemID) | ||
209 | //{ | ||
210 | // remoteScript[localID].Events.not_at_rot_target(localID, itemID); | ||
211 | //} | ||
212 | |||
213 | //public void run_time_permissions(uint localID, UUID itemID) | ||
214 | //{ | ||
215 | // remoteScript[localID].Events.run_time_permissions(localID, itemID); | ||
216 | //} | ||
217 | |||
218 | //public void changed(uint localID, UUID itemID) | ||
219 | //{ | ||
220 | // remoteScript[localID].Events.changed(localID, itemID); | ||
221 | //} | ||
222 | |||
223 | //public void attach(uint localID, UUID itemID) | ||
224 | //{ | ||
225 | // remoteScript[localID].Events.attach(localID, itemID); | ||
226 | //} | ||
227 | |||
228 | //public void dataserver(uint localID, UUID itemID) | ||
229 | //{ | ||
230 | // remoteScript[localID].Events.dataserver(localID, itemID); | ||
231 | //} | ||
232 | |||
233 | //public void link_message(uint localID, UUID itemID) | ||
234 | //{ | ||
235 | // remoteScript[localID].Events.link_message(localID, itemID); | ||
236 | //} | ||
237 | |||
238 | //public void moving_start(uint localID, UUID itemID) | ||
239 | //{ | ||
240 | // remoteScript[localID].Events.moving_start(localID, itemID); | ||
241 | //} | ||
242 | |||
243 | //public void moving_end(uint localID, UUID itemID) | ||
244 | //{ | ||
245 | // remoteScript[localID].Events.moving_end(localID, itemID); | ||
246 | //} | ||
247 | |||
248 | //public void object_rez(uint localID, UUID itemID) | ||
249 | //{ | ||
250 | // remoteScript[localID].Events.object_rez(localID, itemID); | ||
251 | //} | ||
252 | |||
253 | //public void remote_data(uint localID, UUID itemID) | ||
254 | //{ | ||
255 | // remoteScript[localID].Events.remote_data(localID, itemID); | ||
256 | //} | ||
257 | |||
258 | //public void http_response(uint localID, UUID itemID) | ||
259 | //{ | ||
260 | // remoteScript[localID].Events.http_response(localID, itemID); | ||
261 | //} | ||
262 | } | ||
263 | } | ||