aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common/OpenSim.Servers
diff options
context:
space:
mode:
Diffstat (limited to 'Common/OpenSim.Servers')
-rw-r--r--Common/OpenSim.Servers/BaseHttpServer.cs312
-rw-r--r--Common/OpenSim.Servers/CheckSumServer.cs141
-rw-r--r--Common/OpenSim.Servers/IRestHandler.cs35
-rw-r--r--Common/OpenSim.Servers/OpenSim.Servers.csproj125
-rw-r--r--Common/OpenSim.Servers/OpenSim.Servers.dll.build51
-rw-r--r--Common/OpenSim.Servers/UDPServerBase.cs95
-rw-r--r--Common/OpenSim.Servers/XmlRpcMethod.cs34
7 files changed, 0 insertions, 793 deletions
diff --git a/Common/OpenSim.Servers/BaseHttpServer.cs b/Common/OpenSim.Servers/BaseHttpServer.cs
deleted file mode 100644
index e55e33c..0000000
--- a/Common/OpenSim.Servers/BaseHttpServer.cs
+++ /dev/null
@@ -1,312 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.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*/
28using System;
29using System.Collections.Generic;
30using System.Net;
31using System.Text;
32using System.Text.RegularExpressions;
33using System.Threading;
34//using OpenSim.CAPS;
35using Nwc.XmlRpc;
36using System.Collections;
37using OpenSim.Framework.Console;
38
39namespace OpenSim.Servers
40{
41 public class BaseHttpServer
42 {
43 protected class RestMethodEntry
44 {
45 private string m_path;
46 public string Path
47 {
48 get { return m_path; }
49 }
50
51 private RestMethod m_restMethod;
52 public RestMethod RestMethod
53 {
54 get { return m_restMethod; }
55 }
56
57 public RestMethodEntry(string path, RestMethod restMethod)
58 {
59 m_path = path;
60 m_restMethod = restMethod;
61 }
62 }
63
64 protected Thread m_workerThread;
65 protected HttpListener m_httpListener;
66 protected Dictionary<string, RestMethodEntry> m_restHandlers = new Dictionary<string, RestMethodEntry>();
67 protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>();
68 protected int m_port;
69 protected bool firstcaps = true;
70
71 public BaseHttpServer(int port)
72 {
73 m_port = port;
74 }
75
76 public bool AddRestHandler(string method, string path, RestMethod handler)
77 {
78 //Console.WriteLine("adding new REST handler for path " + path);
79 string methodKey = String.Format("{0}: {1}", method, path);
80
81 if (!this.m_restHandlers.ContainsKey(methodKey))
82 {
83 this.m_restHandlers.Add(methodKey, new RestMethodEntry(path, handler));
84 return true;
85 }
86
87 //must already have a handler for that path so return false
88 return false;
89 }
90
91 public bool RemoveRestHandler(string method, string path)
92 {
93 string methodKey = String.Format("{0}: {1}", method, path);
94 if (this.m_restHandlers.ContainsKey(methodKey))
95 {
96 this.m_restHandlers.Remove(methodKey);
97 return true;
98 }
99 return false;
100 }
101
102 public bool AddXmlRPCHandler(string method, XmlRpcMethod handler)
103 {
104 if (!this.m_rpcHandlers.ContainsKey(method))
105 {
106 this.m_rpcHandlers.Add(method, handler);
107 return true;
108 }
109
110 //must already have a handler for that path so return false
111 return false;
112 }
113
114 protected virtual string ProcessXMLRPCMethod(string methodName, XmlRpcRequest request)
115 {
116 XmlRpcResponse response;
117
118 XmlRpcMethod method;
119 if (this.m_rpcHandlers.TryGetValue(methodName, out method))
120 {
121 response = method(request);
122 }
123 else
124 {
125 response = new XmlRpcResponse();
126 Hashtable unknownMethodError = new Hashtable();
127 unknownMethodError["reason"] = "XmlRequest"; ;
128 unknownMethodError["message"] = "Unknown Rpc request";
129 unknownMethodError["login"] = "false";
130 response.Value = unknownMethodError;
131 }
132
133 return XmlRpcResponseSerializer.Singleton.Serialize(response);
134 }
135
136 protected virtual string ParseREST(string request, string path, string method)
137 {
138 string response;
139
140 string requestKey = String.Format("{0}: {1}", method, path);
141
142 string bestMatch = String.Empty;
143 foreach (string currentKey in m_restHandlers.Keys)
144 {
145 if (requestKey.StartsWith(currentKey))
146 {
147 if (currentKey.Length > bestMatch.Length)
148 {
149 bestMatch = currentKey;
150 }
151 }
152 }
153
154 RestMethodEntry restMethodEntry;
155 if (m_restHandlers.TryGetValue(bestMatch, out restMethodEntry))
156 {
157 RestMethod restMethod = restMethodEntry.RestMethod;
158
159 string param = path.Substring(restMethodEntry.Path.Length);
160 response = restMethod(request, path, param);
161
162 }
163 else
164 {
165 response = String.Empty;
166 }
167
168 return response;
169 }
170
171 protected virtual string ParseLLSDXML(string requestBody)
172 {
173 // dummy function for now - IMPLEMENT ME!
174 Console.WriteLine("LLSD request "+requestBody);
175 string resp = "";
176 if (firstcaps)
177 {
178 resp = "<llsd><map><key>MapLayer</key><string>http://127.0.0.1:9000/CAPS/</string></map></llsd>";
179 firstcaps = false;
180 }
181 return resp;
182 }
183
184 protected virtual string ParseXMLRPC(string requestBody)
185 {
186 string responseString = String.Empty;
187
188 try
189 {
190 XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody);
191
192 string methodName = request.MethodName;
193
194 responseString = ProcessXMLRPCMethod(methodName, request);
195 }
196 catch (Exception e)
197 {
198 Console.WriteLine(e.ToString());
199 }
200 return responseString;
201 }
202
203 public virtual void HandleRequest(Object stateinfo)
204 {
205 try
206 {
207 HttpListenerContext context = (HttpListenerContext)stateinfo;
208
209 HttpListenerRequest request = context.Request;
210 HttpListenerResponse response = context.Response;
211
212 response.KeepAlive = false;
213 response.SendChunked = false;
214
215 System.IO.Stream body = request.InputStream;
216 System.Text.Encoding encoding = System.Text.Encoding.UTF8;
217 System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding);
218
219 string requestBody = reader.ReadToEnd();
220 body.Close();
221 reader.Close();
222
223 //Console.WriteLine(request.HttpMethod + " " + request.RawUrl + " Http/" + request.ProtocolVersion.ToString() + " content type: " + request.ContentType);
224 //Console.WriteLine(requestBody);
225
226 string responseString = "";
227 // Console.WriteLine("new request " + request.ContentType +" at "+ request.RawUrl);
228 switch (request.ContentType)
229 {
230 case "text/xml":
231 // must be XML-RPC, so pass to the XML-RPC parser
232
233 responseString = ParseXMLRPC(requestBody);
234 responseString = Regex.Replace(responseString, "utf-16", "utf-8");
235
236 response.AddHeader("Content-type", "text/xml");
237 break;
238
239 case "application/xml":
240 // probably LLSD we hope, otherwise it should be ignored by the parser
241 // responseString = ParseLLSDXML(requestBody);
242 responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
243 response.AddHeader("Content-type", "application/xml");
244 break;
245
246 case "application/octet-stream":
247 // probably LLSD we hope, otherwise it should be ignored by the parser
248 // responseString = ParseLLSDXML(requestBody);
249 responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
250 response.AddHeader("Content-type", "application/xml");
251 break;
252
253 case "application/x-www-form-urlencoded":
254 // a form data POST so send to the REST parser
255 responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
256 response.AddHeader("Content-type", "text/html");
257 break;
258
259 case null:
260 // must be REST or invalid crap, so pass to the REST parser
261 responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
262 response.AddHeader("Content-type", "text/html");
263 break;
264
265 }
266
267 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
268 System.IO.Stream output = response.OutputStream;
269 response.SendChunked = false;
270 response.ContentLength64 = buffer.Length;
271 output.Write(buffer, 0, buffer.Length);
272 output.Close();
273 }
274 catch (Exception e)
275 {
276 Console.WriteLine(e.ToString());
277 }
278 }
279
280 public void Start()
281 {
282 OpenSim.Framework.Console.MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: Starting up HTTP Server");
283
284 m_workerThread = new Thread(new ThreadStart(StartHTTP));
285 m_workerThread.IsBackground = true;
286 m_workerThread.Start();
287 }
288
289 private void StartHTTP()
290 {
291 try
292 {
293 OpenSim.Framework.Console.MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: StartHTTP() - Spawned main thread OK");
294 m_httpListener = new HttpListener();
295
296 m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
297 m_httpListener.Start();
298
299 HttpListenerContext context;
300 while (true)
301 {
302 context = m_httpListener.GetContext();
303 ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context);
304 }
305 }
306 catch (Exception e)
307 {
308 OpenSim.Framework.Console.MainLog.Instance.WriteLine(LogPriority.MEDIUM, e.Message);
309 }
310 }
311 }
312}
diff --git a/Common/OpenSim.Servers/CheckSumServer.cs b/Common/OpenSim.Servers/CheckSumServer.cs
deleted file mode 100644
index a359205..0000000
--- a/Common/OpenSim.Servers/CheckSumServer.cs
+++ /dev/null
@@ -1,141 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.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*/
28using System;
29using System.Text;
30using System.IO;
31using System.Threading;
32using System.Net;
33using System.Net.Sockets;
34using System.Timers;
35using System.Reflection;
36using System.Collections;
37using System.Collections.Generic;
38using libsecondlife;
39using libsecondlife.Packets;
40using OpenSim.Framework.Console;
41
42
43namespace OpenSim.Servers
44{
45/* public class CheckSumServer : UDPServerBase
46 {
47 //protected ConsoleBase m_log;
48
49 public CheckSumServer(int port)
50 : base(port)
51 {
52 }
53
54 protected override void OnReceivedData(IAsyncResult result)
55 {
56 ipeSender = new IPEndPoint(IPAddress.Any, 0);
57 epSender = (EndPoint)ipeSender;
58 Packet packet = null;
59 int numBytes = Server.EndReceiveFrom(result, ref epSender);
60 int packetEnd = numBytes - 1;
61
62 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
63
64 if (packet.Type == PacketType.SecuredTemplateChecksumRequest)
65 {
66 SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet;
67 TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket();
68 checkreply.DataBlock.Checksum = 3220703154;//180572585;
69 checkreply.DataBlock.Flags = 0;
70 checkreply.DataBlock.MajorVersion = 1;
71 checkreply.DataBlock.MinorVersion = 15;
72 checkreply.DataBlock.PatchVersion = 0;
73 checkreply.DataBlock.ServerVersion = 0;
74 checkreply.TokenBlock.Token = checksum.TokenBlock.Token;
75 this.SendPacket(checkreply, epSender);
76
77 /*
78 //if we wanted to echo the the checksum/ version from the client (so that any client worked)
79 SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket();
80 checkrequest.TokenBlock.Token = checksum.TokenBlock.Token;
81 this.SendPacket(checkrequest, epSender);
82
83 }
84 else if (packet.Type == PacketType.TemplateChecksumReply)
85 {
86 //echo back the client checksum reply (Hegemon's method)
87 TemplateChecksumReplyPacket checksum2 = (TemplateChecksumReplyPacket)packet;
88 TemplateChecksumReplyPacket checkreply2 = new TemplateChecksumReplyPacket();
89 checkreply2.DataBlock.Checksum = checksum2.DataBlock.Checksum;
90 checkreply2.DataBlock.Flags = checksum2.DataBlock.Flags;
91 checkreply2.DataBlock.MajorVersion = checksum2.DataBlock.MajorVersion;
92 checkreply2.DataBlock.MinorVersion = checksum2.DataBlock.MinorVersion;
93 checkreply2.DataBlock.PatchVersion = checksum2.DataBlock.PatchVersion;
94 checkreply2.DataBlock.ServerVersion = checksum2.DataBlock.ServerVersion;
95 checkreply2.TokenBlock.Token = checksum2.TokenBlock.Token;
96 this.SendPacket(checkreply2, epSender);
97 }
98 else
99 {
100 }
101
102 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
103 }
104
105 private void SendPacket(Packet Pack, EndPoint endp)
106 {
107 if (!Pack.Header.Resent)
108 {
109 Pack.Header.Sequence = 1;
110 }
111
112 byte[] ZeroOutBuffer = new byte[4096];
113 byte[] sendbuffer;
114 sendbuffer = Pack.ToBytes();
115
116 try
117 {
118 if (Pack.Header.Zerocoded)
119 {
120 int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
121 this.SendPackTo(ZeroOutBuffer, packetsize, SocketFlags.None, endp);
122 }
123 else
124 {
125 this.SendPackTo(sendbuffer, sendbuffer.Length, SocketFlags.None, endp);
126 }
127 }
128 catch (Exception)
129 {
130 OpenSim.Framework.Console.MainLog.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection ");
131
132 }
133 }
134
135 private void SendPackTo(byte[] buffer, int size, SocketFlags flags, EndPoint endp)
136 {
137 this.Server.SendTo(buffer, size, flags, endp);
138 }
139 *
140 }*/
141} \ No newline at end of file
diff --git a/Common/OpenSim.Servers/IRestHandler.cs b/Common/OpenSim.Servers/IRestHandler.cs
deleted file mode 100644
index 3aa508c..0000000
--- a/Common/OpenSim.Servers/IRestHandler.cs
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.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*/
28using System;
29using System.Collections.Generic;
30using System.Text;
31
32namespace OpenSim.Servers
33{
34 public delegate string RestMethod( string request, string path, string param );
35}
diff --git a/Common/OpenSim.Servers/OpenSim.Servers.csproj b/Common/OpenSim.Servers/OpenSim.Servers.csproj
deleted file mode 100644
index 6e8eba7..0000000
--- a/Common/OpenSim.Servers/OpenSim.Servers.csproj
+++ /dev/null
@@ -1,125 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{8BB20F0A-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon>
10 </ApplicationIcon>
11 <AssemblyKeyContainerName>
12 </AssemblyKeyContainerName>
13 <AssemblyName>OpenSim.Servers</AssemblyName>
14 <DefaultClientScript>JScript</DefaultClientScript>
15 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
16 <DefaultTargetSchema>IE50</DefaultTargetSchema>
17 <DelaySign>false</DelaySign>
18 <OutputType>Library</OutputType>
19 <AppDesignerFolder>
20 </AppDesignerFolder>
21 <RootNamespace>OpenSim.Servers</RootNamespace>
22 <StartupObject>
23 </StartupObject>
24 <FileUpgradeFlags>
25 </FileUpgradeFlags>
26 </PropertyGroup>
27 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
28 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
29 <BaseAddress>285212672</BaseAddress>
30 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
31 <ConfigurationOverrideFile>
32 </ConfigurationOverrideFile>
33 <DefineConstants>TRACE;DEBUG</DefineConstants>
34 <DocumentationFile>
35 </DocumentationFile>
36 <DebugSymbols>True</DebugSymbols>
37 <FileAlignment>4096</FileAlignment>
38 <Optimize>False</Optimize>
39 <OutputPath>..\..\bin\</OutputPath>
40 <RegisterForComInterop>False</RegisterForComInterop>
41 <RemoveIntegerChecks>False</RemoveIntegerChecks>
42 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
43 <WarningLevel>4</WarningLevel>
44 <NoWarn>
45 </NoWarn>
46 </PropertyGroup>
47 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
48 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
49 <BaseAddress>285212672</BaseAddress>
50 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
51 <ConfigurationOverrideFile>
52 </ConfigurationOverrideFile>
53 <DefineConstants>TRACE</DefineConstants>
54 <DocumentationFile>
55 </DocumentationFile>
56 <DebugSymbols>False</DebugSymbols>
57 <FileAlignment>4096</FileAlignment>
58 <Optimize>True</Optimize>
59 <OutputPath>..\..\bin\</OutputPath>
60 <RegisterForComInterop>False</RegisterForComInterop>
61 <RemoveIntegerChecks>False</RemoveIntegerChecks>
62 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
63 <WarningLevel>4</WarningLevel>
64 <NoWarn>
65 </NoWarn>
66 </PropertyGroup>
67 <ItemGroup>
68 <Reference Include="libsecondlife.dll">
69 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
70 <Private>False</Private>
71 </Reference>
72 <Reference Include="System">
73 <HintPath>System.dll</HintPath>
74 <Private>False</Private>
75 </Reference>
76 <Reference Include="System.Xml">
77 <HintPath>System.Xml.dll</HintPath>
78 <Private>False</Private>
79 </Reference>
80 </ItemGroup>
81 <ItemGroup>
82 <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
83 <Name>OpenSim.Framework</Name>
84 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
85 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
86 <Private>False</Private>
87 </ProjectReference>
88 <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
89 <Name>OpenSim.Framework.Console</Name>
90 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
91 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
92 <Private>False</Private>
93 </ProjectReference>
94 <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
95 <Name>XMLRPC</Name>
96 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
97 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
98 <Private>False</Private>
99 </ProjectReference>
100 </ItemGroup>
101 <ItemGroup>
102 <Compile Include="BaseHttpServer.cs">
103 <SubType>Code</SubType>
104 </Compile>
105 <Compile Include="CheckSumServer.cs">
106 <SubType>Code</SubType>
107 </Compile>
108 <Compile Include="IRestHandler.cs">
109 <SubType>Code</SubType>
110 </Compile>
111 <Compile Include="UDPServerBase.cs">
112 <SubType>Code</SubType>
113 </Compile>
114 <Compile Include="XmlRpcMethod.cs">
115 <SubType>Code</SubType>
116 </Compile>
117 </ItemGroup>
118 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
119 <PropertyGroup>
120 <PreBuildEvent>
121 </PreBuildEvent>
122 <PostBuildEvent>
123 </PostBuildEvent>
124 </PropertyGroup>
125</Project> \ No newline at end of file
diff --git a/Common/OpenSim.Servers/OpenSim.Servers.dll.build b/Common/OpenSim.Servers/OpenSim.Servers.dll.build
deleted file mode 100644
index 4103e73..0000000
--- a/Common/OpenSim.Servers/OpenSim.Servers.dll.build
+++ /dev/null
@@ -1,51 +0,0 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Servers" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Servers" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="BaseHttpServer.cs" />
15 <include name="CheckSumServer.cs" />
16 <include name="IRestHandler.cs" />
17 <include name="LocalUserProfileManager.cs" />
18 <include name="LoginResponse.cs" />
19 <include name="LoginServer.cs" />
20 <include name="UDPServerBase.cs" />
21 <include name="XmlRpcMethod.cs" />
22 </sources>
23 <references basedir="${project::get-base-directory()}">
24 <lib>
25 <include name="${project::get-base-directory()}" />
26 <include name="${project::get-base-directory()}/${build.dir}" />
27 </lib>
28 <include name="../../bin/libsecondlife.dll" />
29 <include name="../../bin/OpenSim.Framework.dll" />
30 <include name="../../bin/OpenSim.Framework.Console.dll" />
31 <include name="System.dll" />
32 <include name="System.Xml.dll" />
33 <include name="../../bin/XMLRPC.dll" />
34 </references>
35 </csc>
36 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
37 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
38 <copy todir="${project::get-base-directory()}/../../bin/">
39 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
40 <include name="*.dll"/>
41 <include name="*.exe"/>
42 </fileset>
43 </copy>
44 </target>
45 <target name="clean">
46 <delete dir="${bin.dir}" failonerror="false" />
47 <delete dir="${obj.dir}" failonerror="false" />
48 </target>
49 <target name="doc" description="Creates documentation.">
50 </target>
51</project>
diff --git a/Common/OpenSim.Servers/UDPServerBase.cs b/Common/OpenSim.Servers/UDPServerBase.cs
deleted file mode 100644
index b472c97..0000000
--- a/Common/OpenSim.Servers/UDPServerBase.cs
+++ /dev/null
@@ -1,95 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.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*/
28using System;
29using System.Text;
30using System.IO;
31using System.Threading;
32using System.Net;
33using System.Net.Sockets;
34using System.Timers;
35using System.Reflection;
36using System.Collections;
37using System.Collections.Generic;
38using libsecondlife;
39using libsecondlife.Packets;
40
41namespace OpenSim.Servers
42{
43 public class UDPServerBase
44 {
45 public Socket Server;
46 protected IPEndPoint ServerIncoming;
47 protected byte[] RecvBuffer = new byte[4096];
48 protected byte[] ZeroBuffer = new byte[8192];
49 protected IPEndPoint ipeSender;
50 protected EndPoint epSender;
51 protected AsyncCallback ReceivedData;
52 protected int listenPort;
53
54 public UDPServerBase(int port)
55 {
56 listenPort = port;
57 }
58
59 protected virtual void OnReceivedData(IAsyncResult result)
60 {
61 ipeSender = new IPEndPoint(IPAddress.Any, 0);
62 epSender = (EndPoint)ipeSender;
63 Packet packet = null;
64 int numBytes = Server.EndReceiveFrom(result, ref epSender);
65 int packetEnd = numBytes - 1;
66
67 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
68
69 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
70 }
71
72 protected virtual void AddNewClient(Packet packet)
73 {
74 }
75
76 public virtual void ServerListener()
77 {
78
79 ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort);
80 Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
81 Server.Bind(ServerIncoming);
82
83 ipeSender = new IPEndPoint(IPAddress.Any, 0);
84 epSender = (EndPoint)ipeSender;
85 ReceivedData = new AsyncCallback(this.OnReceivedData);
86 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
87 }
88
89 public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)
90 {
91
92 }
93 }
94}
95
diff --git a/Common/OpenSim.Servers/XmlRpcMethod.cs b/Common/OpenSim.Servers/XmlRpcMethod.cs
deleted file mode 100644
index 05cbf2e..0000000
--- a/Common/OpenSim.Servers/XmlRpcMethod.cs
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.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*/
28using System;
29using Nwc.XmlRpc;
30
31namespace OpenSim.Servers
32{
33 public delegate XmlRpcResponse XmlRpcMethod( XmlRpcRequest request );
34}