aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Common/OpenSim.Servers/OpenSim.Servers.csproj3
-rw-r--r--Common/OpenSim.Servers/OpenSim.Servers.dll.build1
-rw-r--r--Common/OpenSim.Servers/SocketRegistry.cs63
-rw-r--r--Common/OpenSim.Servers/UDPServerBase.cs8
-rw-r--r--OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build4
-rw-r--r--OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build6
-rw-r--r--OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build10
-rw-r--r--OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build10
-rw-r--r--OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj.user2
-rw-r--r--OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.exe.build10
-rw-r--r--OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build10
-rw-r--r--OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build4
-rw-r--r--OpenGridServices/ServiceManager/ServiceManager.exe.build4
-rw-r--r--OpenSim/OpenSim.RegionServer/UDPServer.cs11
-rw-r--r--OpenSim/OpenSim/Application.cs153
-rw-r--r--Prebuild/Prebuild.sln26
16 files changed, 213 insertions, 112 deletions
diff --git a/Common/OpenSim.Servers/OpenSim.Servers.csproj b/Common/OpenSim.Servers/OpenSim.Servers.csproj
index a4f56fe..7a99206 100644
--- a/Common/OpenSim.Servers/OpenSim.Servers.csproj
+++ b/Common/OpenSim.Servers/OpenSim.Servers.csproj
@@ -113,6 +113,9 @@
113 <Compile Include="LoginServer.cs"> 113 <Compile Include="LoginServer.cs">
114 <SubType>Code</SubType> 114 <SubType>Code</SubType>
115 </Compile> 115 </Compile>
116 <Compile Include="SocketRegistry.cs">
117 <SubType>Code</SubType>
118 </Compile>
116 <Compile Include="UDPServerBase.cs"> 119 <Compile Include="UDPServerBase.cs">
117 <SubType>Code</SubType> 120 <SubType>Code</SubType>
118 </Compile> 121 </Compile>
diff --git a/Common/OpenSim.Servers/OpenSim.Servers.dll.build b/Common/OpenSim.Servers/OpenSim.Servers.dll.build
index 25bcd65..6147ea7 100644
--- a/Common/OpenSim.Servers/OpenSim.Servers.dll.build
+++ b/Common/OpenSim.Servers/OpenSim.Servers.dll.build
@@ -18,6 +18,7 @@
18 <include name="LocalUserProfileManager.cs" /> 18 <include name="LocalUserProfileManager.cs" />
19 <include name="LoginResponse.cs" /> 19 <include name="LoginResponse.cs" />
20 <include name="LoginServer.cs" /> 20 <include name="LoginServer.cs" />
21 <include name="SocketRegistry.cs" />
21 <include name="UDPServerBase.cs" /> 22 <include name="UDPServerBase.cs" />
22 <include name="XmlRpcMethod.cs" /> 23 <include name="XmlRpcMethod.cs" />
23 </sources> 24 </sources>
diff --git a/Common/OpenSim.Servers/SocketRegistry.cs b/Common/OpenSim.Servers/SocketRegistry.cs
new file mode 100644
index 0000000..2ebf80c
--- /dev/null
+++ b/Common/OpenSim.Servers/SocketRegistry.cs
@@ -0,0 +1,63 @@
1/*
2 * Created by SharpDevelop.
3 * User: Adam Stevenson
4 * Date: 6/13/2007
5 * Time: 12:55 AM
6 *
7 * To change this template use Tools | Options | Coding | Edit Standard Headers.
8 */
9
10using System;
11using System.Collections.Generic;
12using System.Net;
13using System.Net.Sockets;
14
15namespace OpenSim.Servers
16{
17 /// <summary>
18 ///
19 /// </summary>
20 public class SocketRegistry
21 {
22 static List<Socket> _Sockets;
23
24 static SocketRegistry()
25 {
26 _Sockets = new List<Socket>();
27 }
28
29 private SocketRegistry()
30 {
31
32 }
33
34 public static void Register(Socket pSocket)
35 {
36 _Sockets.Add(pSocket);
37 }
38
39 public static void Unregister(Socket pSocket)
40 {
41 _Sockets.Remove(pSocket);
42 }
43
44 public static void UnregisterAllAndClose()
45 {
46 int iSockets = _Sockets.Count;
47
48 for (int i = 0; i < iSockets; i++)
49 {
50 try
51 {
52 _Sockets[i].Close();
53 }
54 catch
55 {
56
57 }
58 }
59
60 _Sockets.Clear();
61 }
62 }
63}
diff --git a/Common/OpenSim.Servers/UDPServerBase.cs b/Common/OpenSim.Servers/UDPServerBase.cs
index b472c97..b763315 100644
--- a/Common/OpenSim.Servers/UDPServerBase.cs
+++ b/Common/OpenSim.Servers/UDPServerBase.cs
@@ -78,6 +78,13 @@ namespace OpenSim.Servers
78 78
79 ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort); 79 ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort);
80 Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); 80 Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
81
82 /// Add this new socket to the list of sockets that was opened by the application. When the application
83 /// closes, either gracefully or not, all sockets can be cleaned up. Right now I am not aware of any method
84 /// to get all of the sockets for a process within .NET, but if so, this process can be refactored, as
85 /// socket registration would not be neccessary.
86 SocketRegistry.Register(Server);
87
81 Server.Bind(ServerIncoming); 88 Server.Bind(ServerIncoming);
82 89
83 ipeSender = new IPEndPoint(IPAddress.Any, 0); 90 ipeSender = new IPEndPoint(IPAddress.Any, 0);
@@ -93,3 +100,4 @@ namespace OpenSim.Servers
93 } 100 }
94} 101}
95 102
103
diff --git a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build
index 075593b..d0ba0a8 100644
--- a/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build
+++ b/OpenGridServices/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build
@@ -21,8 +21,8 @@
21 </lib> 21 </lib>
22 <include name="../../../bin/Db4objects.Db4o.dll" /> 22 <include name="../../../bin/Db4objects.Db4o.dll" />
23 <include name="../../../bin/libsecondlife.dll" /> 23 <include name="../../../bin/libsecondlife.dll" />
24 <include name="../../../bin/OpenSim.Framework.dll" /> 24 <include name="OpenSim.Framework.dll" />
25 <include name="../../../bin/OpenSim.Framework.Console.dll" /> 25 <include name="OpenSim.Framework.Console.dll" />
26 <include name="System.dll" /> 26 <include name="System.dll" />
27 <include name="System.Data.dll.dll" /> 27 <include name="System.Data.dll.dll" />
28 <include name="System.Xml.dll" /> 28 <include name="System.Xml.dll" />
diff --git a/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build b/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build
index 9430ab9..7195699 100644
--- a/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build
+++ b/OpenGridServices/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build
@@ -20,10 +20,10 @@
20 <include name="${project::get-base-directory()}/${build.dir}" /> 20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib> 21 </lib>
22 <include name="../../bin/libsecondlife.dll" /> 22 <include name="../../bin/libsecondlife.dll" />
23 <include name="../../bin/OpenSim.Framework.dll" /> 23 <include name="OpenSim.Framework.dll.dll" />
24 <include name="../../bin/OpenSim.Servers.dll" /> 24 <include name="OpenSim.Servers.dll.dll" />
25 <include name="System.dll" /> 25 <include name="System.dll" />
26 <include name="../../bin/XMLRPC.dll" /> 26 <include name="XMLRPC.dll" />
27 </references> 27 </references>
28 </csc> 28 </csc>
29 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" /> 29 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
diff --git a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build
index 808f015..f9976e3 100644
--- a/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build
+++ b/OpenGridServices/OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build
@@ -22,14 +22,14 @@
22 </lib> 22 </lib>
23 <include name="../../bin/Db4objects.Db4o.dll" /> 23 <include name="../../bin/Db4objects.Db4o.dll" />
24 <include name="../../bin/libsecondlife.dll" /> 24 <include name="../../bin/libsecondlife.dll" />
25 <include name="../../bin/OpenSim.Framework.dll" /> 25 <include name="OpenSim.Framework.dll" />
26 <include name="../../bin/OpenSim.Framework.Console.dll" /> 26 <include name="OpenSim.Framework.Console.dll" />
27 <include name="../../bin/OpenSim.GridInterfaces.Local.dll" /> 27 <include name="OpenSim.GridInterfaces.Local.dll" />
28 <include name="../../bin/OpenSim.Servers.dll" /> 28 <include name="OpenSim.Servers.dll" />
29 <include name="System.dll" /> 29 <include name="System.dll" />
30 <include name="System.Data.dll" /> 30 <include name="System.Data.dll" />
31 <include name="System.Xml.dll" /> 31 <include name="System.Xml.dll" />
32 <include name="../../bin/XMLRPC.dll" /> 32 <include name="XMLRPC.dll" />
33 </references> 33 </references>
34 </csc> 34 </csc>
35 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" /> 35 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
diff --git a/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build b/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build
index 60c0f85..f8951b7 100644
--- a/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build
+++ b/OpenGridServices/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build
@@ -24,14 +24,14 @@
24 <include name="../../bin/libsecondlife.dll" /> 24 <include name="../../bin/libsecondlife.dll" />
25 <include name="../../bin/OpenGrid.Framework.Data.dll" /> 25 <include name="../../bin/OpenGrid.Framework.Data.dll" />
26 <include name="../../bin/OpenGrid.Framework.Manager.dll" /> 26 <include name="../../bin/OpenGrid.Framework.Manager.dll" />
27 <include name="../../bin/OpenSim.Framework.dll" /> 27 <include name="OpenSim.Framework.dll" />
28 <include name="../../bin/OpenSim.Framework.Console.dll" /> 28 <include name="OpenSim.Framework.Console.dll" />
29 <include name="../../bin/OpenSim.GenericConfig.Xml.dll" /> 29 <include name="OpenSim.GenericConfig.Xml.dll" />
30 <include name="../../bin/OpenSim.Servers.dll" /> 30 <include name="OpenSim.Servers.dll" />
31 <include name="System.dll" /> 31 <include name="System.dll" />
32 <include name="System.Data.dll" /> 32 <include name="System.Data.dll" />
33 <include name="System.Xml.dll" /> 33 <include name="System.Xml.dll" />
34 <include name="../../bin/XMLRPC.dll" /> 34 <include name="XMLRPC.dll" />
35 </references> 35 </references>
36 </csc> 36 </csc>
37 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" /> 37 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
diff --git a/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj.user b/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj.user
index ea58087..179959e 100644
--- a/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj.user
+++ b/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.csproj.user
@@ -2,7 +2,7 @@
2 <PropertyGroup> 2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\Documents and Settings\Stefan\My Documents\source\opensim\trunk\bin\</ReferencePath> 5 <ReferencePath>E:\work\oslauth\sim\trunk\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion> 6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView> 7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust> 8 <ProjectTrust>0</ProjectTrust>
diff --git a/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.exe.build b/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.exe.build
index 5e67af1..ff980ad 100644
--- a/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.exe.build
+++ b/OpenGridServices/OpenGridServices.InventoryServer/OpenGridServices.InventoryServer.exe.build
@@ -22,14 +22,14 @@
22 <include name="../../bin/Db4objects.Db4o.dll" /> 22 <include name="../../bin/Db4objects.Db4o.dll" />
23 <include name="../../bin/libsecondlife.dll" /> 23 <include name="../../bin/libsecondlife.dll" />
24 <include name="../../bin/OpenGrid.Framework.Data.dll" /> 24 <include name="../../bin/OpenGrid.Framework.Data.dll" />
25 <include name="../../bin/OpenSim.Framework.dll" /> 25 <include name="OpenSim.Framework.dll" />
26 <include name="../../bin/OpenSim.Framework.Console.dll" /> 26 <include name="OpenSim.Framework.Console.dll" />
27 <include name="../../bin/OpenSim.GridInterfaces.Local.dll" /> 27 <include name="OpenSim.GridInterfaces.Local.dll" />
28 <include name="../../bin/OpenSim.Servers.dll" /> 28 <include name="OpenSim.Servers.dll" />
29 <include name="System.dll" /> 29 <include name="System.dll" />
30 <include name="System.Data.dll" /> 30 <include name="System.Data.dll" />
31 <include name="System.Xml.dll" /> 31 <include name="System.Xml.dll" />
32 <include name="../../bin/XMLRPC.dll" /> 32 <include name="XMLRPC.dll" />
33 </references> 33 </references>
34 </csc> 34 </csc>
35 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" /> 35 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
diff --git a/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build b/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build
index 68cbef7..894c282 100644
--- a/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build
+++ b/OpenGridServices/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build
@@ -23,14 +23,14 @@
23 <include name="../../bin/Db4objects.Db4o.dll" /> 23 <include name="../../bin/Db4objects.Db4o.dll" />
24 <include name="../../bin/libsecondlife.dll" /> 24 <include name="../../bin/libsecondlife.dll" />
25 <include name="../../bin/OpenGrid.Framework.Data.dll" /> 25 <include name="../../bin/OpenGrid.Framework.Data.dll" />
26 <include name="../../bin/OpenSim.Framework.dll" /> 26 <include name="OpenSim.Framework.dll" />
27 <include name="../../bin/OpenSim.Framework.Console.dll" /> 27 <include name="OpenSim.Framework.Console.dll" />
28 <include name="../../bin/OpenSim.GenericConfig.Xml.dll" /> 28 <include name="OpenSim.GenericConfig.Xml.dll" />
29 <include name="../../bin/OpenSim.Servers.dll" /> 29 <include name="OpenSim.Servers.dll" />
30 <include name="System.dll" /> 30 <include name="System.dll" />
31 <include name="System.Data.dll" /> 31 <include name="System.Data.dll" />
32 <include name="System.Xml.dll" /> 32 <include name="System.Xml.dll" />
33 <include name="../../bin/XMLRPC.dll" /> 33 <include name="XMLRPC.dll" />
34 </references> 34 </references>
35 </csc> 35 </csc>
36 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" /> 36 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
diff --git a/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build b/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build
index bd5d49f..31801c7 100644
--- a/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build
+++ b/OpenGridServices/OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build
@@ -21,8 +21,8 @@
21 </lib> 21 </lib>
22 <include name="../../../bin/Db4objects.Db4o.dll" /> 22 <include name="../../../bin/Db4objects.Db4o.dll" />
23 <include name="../../../bin/libsecondlife.dll" /> 23 <include name="../../../bin/libsecondlife.dll" />
24 <include name="../../../bin/OpenSim.Framework.dll" /> 24 <include name="OpenSim.Framework.dll" />
25 <include name="../../../bin/OpenSim.Framework.Console.dll" /> 25 <include name="OpenSim.Framework.Console.dll" />
26 <include name="System.dll" /> 26 <include name="System.dll" />
27 <include name="System.Data.dll.dll" /> 27 <include name="System.Data.dll.dll" />
28 <include name="System.Xml.dll" /> 28 <include name="System.Xml.dll" />
diff --git a/OpenGridServices/ServiceManager/ServiceManager.exe.build b/OpenGridServices/ServiceManager/ServiceManager.exe.build
index e0502c6..d50b1bb 100644
--- a/OpenGridServices/ServiceManager/ServiceManager.exe.build
+++ b/OpenGridServices/ServiceManager/ServiceManager.exe.build
@@ -19,8 +19,8 @@
19 <include name="${project::get-base-directory()}/${build.dir}" /> 19 <include name="${project::get-base-directory()}/${build.dir}" />
20 </lib> 20 </lib>
21 <include name="../../bin/libsecondlife.dll" /> 21 <include name="../../bin/libsecondlife.dll" />
22 <include name="../../bin/OpenSim.Framework.dll" /> 22 <include name="OpenSim.Framework.dll.dll" />
23 <include name="../../bin/OpenSim.GenericConfig.Xml.dll" /> 23 <include name="OpenSim.GenericConfig.Xml.dll" />
24 <include name="System.dll" /> 24 <include name="System.dll" />
25 <include name="System.ServiceProcess.dll" /> 25 <include name="System.ServiceProcess.dll" />
26 <include name="System.Xml.dll" /> 26 <include name="System.Xml.dll" />
diff --git a/OpenSim/OpenSim.RegionServer/UDPServer.cs b/OpenSim/OpenSim.RegionServer/UDPServer.cs
index f0d3367..ae62607 100644
--- a/OpenSim/OpenSim.RegionServer/UDPServer.cs
+++ b/OpenSim/OpenSim.RegionServer/UDPServer.cs
@@ -61,7 +61,7 @@ namespace OpenSim.RegionServer
61 public class UDPServer : OpenSimNetworkHandler 61 public class UDPServer : OpenSimNetworkHandler
62 { 62 {
63 protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); 63 protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
64 public Socket Server; 64 private Socket Server;
65 protected IPEndPoint ServerIncoming; 65 protected IPEndPoint ServerIncoming;
66 protected byte[] RecvBuffer = new byte[4096]; 66 protected byte[] RecvBuffer = new byte[4096];
67 protected byte[] ZeroBuffer = new byte[8192]; 67 protected byte[] ZeroBuffer = new byte[8192];
@@ -201,6 +201,13 @@ namespace OpenSim.RegionServer
201 201
202 ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort); 202 ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort);
203 Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); 203 Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
204
205 /// Add this new socket to the list of sockets that was opened by the application. When the application
206 /// closes, either gracefully or not, all sockets can be cleaned up. Right now I am not aware of any method
207 /// to get all of the sockets for a process within .NET, but if so, this process can be refactored, as
208 /// socket registration would not be neccessary.
209 SocketRegistry.Register(Server);
210
204 Server.Bind(ServerIncoming); 211 Server.Bind(ServerIncoming);
205 212
206 m_console.Notice("UDPServer.cs:ServerListener() - UDP socket bound, getting ready to listen"); 213 m_console.Notice("UDPServer.cs:ServerListener() - UDP socket bound, getting ready to listen");
@@ -255,4 +262,4 @@ namespace OpenSim.RegionServer
255 return this.AuthenticateHandler(sessionID, agentID, circuitCode); 262 return this.AuthenticateHandler(sessionID, agentID, circuitCode);
256 } 263 }
257 } 264 }
258} \ No newline at end of file 265}
diff --git a/OpenSim/OpenSim/Application.cs b/OpenSim/OpenSim/Application.cs
index e3b23ad..15fcd93 100644
--- a/OpenSim/OpenSim/Application.cs
+++ b/OpenSim/OpenSim/Application.cs
@@ -41,84 +41,103 @@ namespace OpenSim
41 [STAThread] 41 [STAThread]
42 public static void Main(string[] args) 42 public static void Main(string[] args)
43 { 43 {
44 Console.WriteLine("OpenSim " + VersionInfo.Version + "\n"); 44 try
45 Console.WriteLine("Starting...\n");
46
47 bool sandBoxMode = false;
48 bool startLoginServer = false;
49 string physicsEngine = "basicphysics";
50 bool allowFlying = false;
51 bool userAccounts = false;
52 bool gridLocalAsset = false;
53 bool useConfigFile = false;
54 bool silent = false;
55 string configFile = "simconfig.xml";
56
57 for (int i = 0; i < args.Length; i++)
58 { 45 {
59 if (args[i] == "-sandbox") 46 Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
60 { 47 Console.WriteLine("Starting...\n");
61 sandBoxMode = true; 48
62 userAccounts = true; 49 bool sandBoxMode = false;
63 startLoginServer = true; 50 bool startLoginServer = false;
64 } 51 string physicsEngine = "basicphysics";
65 /* 52 bool allowFlying = false;
66 if (args[i] == "-loginserver") 53 bool userAccounts = false;
67 { 54 bool gridLocalAsset = false;
68 startLoginServer = true; 55 bool useConfigFile = false;
69 }*/ 56 bool silent = false;
70 if (args[i] == "-accounts") 57 string configFile = "simconfig.xml";
71 { 58
72 userAccounts = true; 59 for (int i = 0; i < args.Length; i++)
73 }
74 if (args[i] == "-realphysx")
75 {
76 physicsEngine = "RealPhysX";
77 allowFlying = true;
78 }
79 if (args[i] == "-ode")
80 {
81 physicsEngine = "OpenDynamicsEngine";
82 allowFlying = true;
83 }
84 if (args[i] == "-localasset")
85 {
86 gridLocalAsset = true;
87 }
88 if (args[i] == "-configfile")
89 {
90 useConfigFile = true;
91 }
92 if (args[i] == "-noverbose")
93 {
94 silent = true;
95 }
96 if (args[i] == "-config")
97 { 60 {
98 try 61 if (args[i] == "-sandbox")
99 { 62 {
100 i++; 63 sandBoxMode = true;
101 configFile = args[i]; 64 userAccounts = true;
65 startLoginServer = true;
102 } 66 }
103 catch (Exception e) 67 /*
68 if (args[i] == "-loginserver")
104 { 69 {
105 Console.WriteLine("-config: Please specify a config file. (" + e.ToString() + ")"); 70 startLoginServer = true;
71 }*/
72 if (args[i] == "-accounts")
73 {
74 userAccounts = true;
75 }
76 if (args[i] == "-realphysx")
77 {
78 physicsEngine = "RealPhysX";
79 allowFlying = true;
80 }
81 if (args[i] == "-ode")
82 {
83 physicsEngine = "OpenDynamicsEngine";
84 allowFlying = true;
85 }
86 if (args[i] == "-localasset")
87 {
88 gridLocalAsset = true;
89 }
90 if (args[i] == "-configfile")
91 {
92 useConfigFile = true;
93 }
94 if (args[i] == "-noverbose")
95 {
96 silent = true;
97 }
98 if (args[i] == "-config")
99 {
100 try
101 {
102 i++;
103 configFile = args[i];
104 }
105 catch (Exception e)
106 {
107 Console.WriteLine("-config: Please specify a config file. (" + e.ToString() + ")");
108 }
106 } 109 }
107 } 110 }
108 }
109 111
110 OpenSimMain sim = new OpenSimMain(sandBoxMode, startLoginServer, physicsEngine, useConfigFile, silent, configFile); 112 OpenSimMain sim = new OpenSimMain(sandBoxMode, startLoginServer, physicsEngine, useConfigFile, silent, configFile);
111 // OpenSimRoot.Instance.Application = sim; 113 // OpenSimRoot.Instance.Application = sim;
112 sim.m_sandbox = sandBoxMode; 114 sim.m_sandbox = sandBoxMode;
113 sim.user_accounts = userAccounts; 115 sim.user_accounts = userAccounts;
114 sim.gridLocalAsset = gridLocalAsset; 116 sim.gridLocalAsset = gridLocalAsset;
115 OpenSim.RegionServer.Simulator.Avatar.PhysicsEngineFlying = allowFlying; 117 OpenSim.RegionServer.Simulator.Avatar.PhysicsEngineFlying = allowFlying;
116 118
117 sim.StartUp(); 119 sim.StartUp();
118 120
119 while (true) 121 while (true)
122 {
123 OpenSim.Framework.Console.MainConsole.Instance.MainConsolePrompt();
124 }
125 }
126 catch (Exception oException)
127 {
128 Console.WriteLine(oException.Message);
129 Console.WriteLine("Fatal error. Server is shutdown. Press 'Enter' to close.");
130 Console.ReadLine();
131
132 }
133 finally
120 { 134 {
121 OpenSim.Framework.Console.MainConsole.Instance.MainConsolePrompt(); 135 /// Ensure that all sockets have been closed before the process closes. This helps ensure that no
136 /// open ports are left open on process that '<do not exist>'. This is in the finally block, as it
137 /// should be done regardless of whether a exception closes the application, or if the application
138 /// is closed normally.
139
140 OpenSim.Servers.SocketRegistry.UnregisterAllAndClose();
122 } 141 }
123 } 142 }
124 } 143 }
diff --git a/Prebuild/Prebuild.sln b/Prebuild/Prebuild.sln
index 227677f..449896b 100644
--- a/Prebuild/Prebuild.sln
+++ b/Prebuild/Prebuild.sln
@@ -3,17 +3,17 @@ Microsoft Visual Studio Solution File, Format Version 9.00
3Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prebuild", "src\Prebuild.csproj", "{92E80C1C-0000-0000-0000-000000000000}" 3Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prebuild", "src\Prebuild.csproj", "{92E80C1C-0000-0000-0000-000000000000}"
4EndProject 4EndProject
5Global 5Global
6 GlobalSection(SolutionConfigurationPlatforms) = preSolution 6 GlobalSection(SolutionConfigurationPlatforms) = preSolution
7 Debug|Any CPU = Debug|Any CPU 7 Debug|Any CPU = Debug|Any CPU
8 Release|Any CPU = Release|Any CPU 8 Release|Any CPU = Release|Any CPU
9 EndGlobalSection 9 EndGlobalSection
10 GlobalSection(ProjectConfigurationPlatforms) = postSolution 10 GlobalSection(ProjectConfigurationPlatforms) = postSolution
11 {92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 11 {92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12 {92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU 12 {92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
13 {92E80C1C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU 13 {92E80C1C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
14 {92E80C1C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU 14 {92E80C1C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
15 EndGlobalSection 15 EndGlobalSection
16 GlobalSection(SolutionProperties) = preSolution 16 GlobalSection(SolutionProperties) = preSolution
17 HideSolutionNode = FALSE 17 HideSolutionNode = FALSE
18 EndGlobalSection 18 EndGlobalSection
19EndGlobal 19EndGlobal