diff options
author | Tedd Hansen | 2008-09-12 18:46:52 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-09-12 18:46:52 +0000 |
commit | 85a0e03984478b58d3568c075fbf3cc1b6e2c6e3 (patch) | |
tree | 299fccb86e9472d03eb1aa0e333c03cf50b290e8 /OpenSim/Region/ScriptEngine | |
parent | use new style asserts. They are much easier to read. (diff) | |
download | opensim-SC_OLD-85a0e03984478b58d3568c075fbf3cc1b6e2c6e3.zip opensim-SC_OLD-85a0e03984478b58d3568c075fbf3cc1b6e2c6e3.tar.gz opensim-SC_OLD-85a0e03984478b58d3568c075fbf3cc1b6e2c6e3.tar.bz2 opensim-SC_OLD-85a0e03984478b58d3568c075fbf3cc1b6e2c6e3.tar.xz |
Note to self: VisualSVN not fully compatible with OpenSim prebuild :)
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
5 files changed, 0 insertions, 569 deletions
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/Common.cs b/OpenSim/Region/ScriptEngine/RemoteServer/Common.cs deleted file mode 100644 index 0a6a98d..0000000 --- a/OpenSim/Region/ScriptEngine/RemoteServer/Common.cs +++ /dev/null | |||
@@ -1,58 +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 | namespace OpenSim.Region.ScriptEngine.RemoteServer | ||
31 | { | ||
32 | public static class Common | ||
33 | { | ||
34 | public static bool debug = true; | ||
35 | public static ScriptEngine mySE; | ||
36 | |||
37 | // This class just contains some static log stuff used for debugging. | ||
38 | |||
39 | //public delegate void SendToDebugEventDelegate(string Message); | ||
40 | //public delegate void SendToLogEventDelegate(string Message); | ||
41 | //static public event SendToDebugEventDelegate SendToDebugEvent; | ||
42 | //static public event SendToLogEventDelegate SendToLogEvent; | ||
43 | |||
44 | public static void SendToDebug(string Message) | ||
45 | { | ||
46 | //if (Debug == true) | ||
47 | mySE.Log.Info("[ScriptEngine]: Debug: " + Message); | ||
48 | //SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); | ||
49 | } | ||
50 | |||
51 | public static void SendToLog(string Message) | ||
52 | { | ||
53 | //if (Debug == true) | ||
54 | mySE.Log.Info("[ScriptEngine]: LOG: " + Message); | ||
55 | //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); | ||
56 | } | ||
57 | } | ||
58 | } | ||
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 | } | ||
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/RemoteServer/Properties/AssemblyInfo.cs deleted file mode 100644 index 77d9b10..0000000 --- a/OpenSim/Region/ScriptEngine/RemoteServer/Properties/AssemblyInfo.cs +++ /dev/null | |||
@@ -1,65 +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 System.Reflection; | ||
29 | using System.Runtime.InteropServices; | ||
30 | |||
31 | // General information about an assembly is controlled through the following | ||
32 | // set of attributes. Change these attribute values to modify the information | ||
33 | // associated with an assembly. | ||
34 | |||
35 | [assembly : AssemblyTitle("OpenSim.Region.ScriptEngine.RemoteServer")] | ||
36 | [assembly : AssemblyDescription("")] | ||
37 | [assembly : AssemblyConfiguration("")] | ||
38 | [assembly : AssemblyCompany("")] | ||
39 | [assembly : AssemblyProduct("OpenSim.Region.ScriptEngine.RemoteServer")] | ||
40 | [assembly : AssemblyCopyright("Copyright (c) OpenSimulator.org Developers 2007-2008")] | ||
41 | [assembly : AssemblyTrademark("")] | ||
42 | [assembly : AssemblyCulture("")] | ||
43 | |||
44 | // Setting ComVisible to false makes the types in this assembly not visible | ||
45 | // to COM components. If you need to access a type in this assembly from | ||
46 | // COM, set the ComVisible attribute to true on that type. | ||
47 | |||
48 | [assembly : ComVisible(false)] | ||
49 | |||
50 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
51 | |||
52 | [assembly : Guid("2842257e-6fde-4460-9368-4cde57fa9cc4")] | ||
53 | |||
54 | // Version information for an assembly consists of the following four values: | ||
55 | // | ||
56 | // Major Version | ||
57 | // Minor Version | ||
58 | // Build Number | ||
59 | // Revision | ||
60 | // | ||
61 | // You can specify all the values or you can default the Revision and Build Numbers | ||
62 | // by using the '*' as shown below: | ||
63 | |||
64 | [assembly : AssemblyVersion("1.0.0.0")] | ||
65 | [assembly : AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs deleted file mode 100644 index 2a51b91..0000000 --- a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs +++ /dev/null | |||
@@ -1,80 +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 System; | ||
29 | using System.Net.Sockets; | ||
30 | using System.Runtime.Remoting; | ||
31 | using System.Runtime.Remoting.Channels; | ||
32 | using System.Runtime.Remoting.Channels.Tcp; | ||
33 | using OpenSim.Region.ScriptEngine.Common; | ||
34 | |||
35 | namespace OpenSim.Region.ScriptEngine.RemoteServer | ||
36 | { | ||
37 | class RemoteServer | ||
38 | { | ||
39 | // Handles connections to servers | ||
40 | // Create and returns server object | ||
41 | |||
42 | public RemoteServer() | ||
43 | { | ||
44 | TcpChannel chan = new TcpChannel(); | ||
45 | ChannelServices.RegisterChannel(chan, true); | ||
46 | } | ||
47 | |||
48 | /// <summary> | ||
49 | /// Create a channel for communicating w/ the remote object | ||
50 | /// Notice no port is specified on the client | ||
51 | /// </summary> | ||
52 | public ScriptServerInterfaces.ServerRemotingObject Connect(string hostname, int port) | ||
53 | { | ||
54 | ScriptServerInterfaces.ServerRemotingObject obj = null; | ||
55 | |||
56 | try | ||
57 | { | ||
58 | // Create an instance of the remote object | ||
59 | obj = (ScriptServerInterfaces.ServerRemotingObject)Activator.GetObject( | ||
60 | typeof(ScriptServerInterfaces.ServerRemotingObject), | ||
61 | "tcp://" + hostname + ":" + port + "/DotNetEngine"); | ||
62 | |||
63 | if (obj == null) | ||
64 | { | ||
65 | Console.WriteLine("Error: unable to locate server"); | ||
66 | } | ||
67 | } | ||
68 | catch (SocketException) | ||
69 | { | ||
70 | Console.WriteLine("Error: unable to connect to server"); | ||
71 | } | ||
72 | catch (RemotingException) | ||
73 | { | ||
74 | Console.WriteLine("Error: unable to connect to server"); | ||
75 | } | ||
76 | |||
77 | return obj; | ||
78 | } | ||
79 | } | ||
80 | } | ||
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs deleted file mode 100644 index ac6ed82..0000000 --- a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs +++ /dev/null | |||
@@ -1,103 +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 System; | ||
29 | using System.Reflection; | ||
30 | using log4net; | ||
31 | using Nini.Config; | ||
32 | using OpenSim.Region.Environment.Interfaces; | ||
33 | using OpenSim.Region.Environment.Scenes; | ||
34 | |||
35 | namespace OpenSim.Region.ScriptEngine.RemoteServer | ||
36 | { | ||
37 | /// <summary> | ||
38 | /// This is the root object for RemoteServer. Objects access each other trough this class. | ||
39 | /// </summary> | ||
40 | /// | ||
41 | [Serializable] | ||
42 | public class ScriptEngine : IRegionModule | ||
43 | { | ||
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
46 | internal Scene World; | ||
47 | internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim | ||
48 | internal RemoteServer m_RemoteServer; // Handles connections to remote servers | ||
49 | |||
50 | public ScriptEngine() | ||
51 | { | ||
52 | Common.mySE = this; | ||
53 | } | ||
54 | |||
55 | public ILog Log | ||
56 | { | ||
57 | get { return m_log; } | ||
58 | } | ||
59 | |||
60 | public void InitializeEngine(Scene Sceneworld) | ||
61 | { | ||
62 | World = Sceneworld; | ||
63 | |||
64 | m_log.Info("[ScriptEngine]: RemoteEngine (Remote Script Server) initializing"); | ||
65 | // Create all objects we'll be using | ||
66 | m_EventManager = new EventManager(this); | ||
67 | m_RemoteServer = new RemoteServer(); | ||
68 | m_RemoteServer.Connect("localhost", 1234); | ||
69 | } | ||
70 | |||
71 | public void Shutdown() | ||
72 | { | ||
73 | // We are shutting down | ||
74 | } | ||
75 | |||
76 | #region IRegionModule | ||
77 | |||
78 | public void Initialise(Scene scene, IConfigSource config) | ||
79 | { | ||
80 | InitializeEngine(scene); | ||
81 | } | ||
82 | |||
83 | public void PostInitialise() | ||
84 | { | ||
85 | } | ||
86 | |||
87 | public void Close() | ||
88 | { | ||
89 | } | ||
90 | |||
91 | public string Name | ||
92 | { | ||
93 | get { return "RemoteServerScriptingModule"; } | ||
94 | } | ||
95 | |||
96 | public bool IsSharedModule | ||
97 | { | ||
98 | get { return false; } | ||
99 | } | ||
100 | |||
101 | #endregion | ||
102 | } | ||
103 | } | ||